繁体   English   中英

是否可以使用 Ansible 使用 start init.d 服务?

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

Ansible 将失败以下任务

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

因为该服务是 init.d 服务而不是 systemd

是否可以使用 Ansible 启动 init.d 服务?

你试过如下

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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