【问题标题】:Is it possible to use start init.d service using Ansible?是否可以使用 Ansible 使用 start init.d 服务?
【发布时间】:2020-03-05 00:25:17
【问题描述】:

Ansible 将失败以下任务

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

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

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

【问题讨论】:

  • 有关 Linux 操作系统的问题应该在 unix.stackexchange.com 上提出
  • 抱歉,但很明显,问题不在于 Linux,而在于 Ansible。由于某种原因,您不清楚。随着 Ansible、Chef、Infrastructure as Code 的出现,基础设施、Linux 等越来越成为一种开发学科,因此请准备好否决更多问题!

标签: ansible systemd init.d


【解决方案1】:

你有没有尝试过以下方法

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

【讨论】:

    猜你喜欢
    • 2015-07-31
    • 1970-01-01
    • 2014-07-16
    • 2014-02-07
    • 1970-01-01
    • 2011-05-28
    • 2011-11-26
    • 1970-01-01
    相关资源
    最近更新 更多