简体   繁体   中英

Is it possible to use start init.d service using Ansible?

Ansible will fail the task below

- name: Start opendj
  service: name={{opendj_service_name}} state=started enabled=yes

because the service is a init.d service and not systemd

Is it possibe to start a init.d service using Ansible?

Have you tried as below

- name: make sure {{opendj_service_name}} is started
  sysvinit:
      name: {{opendj_service_name}}
      state: started
      enabled: yes

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM