【问题标题】:Ansible handler is given a task to start a particular service. What will Ansible handler do if the service is already started when it is called?Ansible 处理程序被赋予启动特定服务的任务。如果服务在被调用时已经启动,Ansible 处理程序会做什么?
【发布时间】:2020-09-03 09:56:53
【问题描述】:

Ansible 处理程序被赋予启动特定服务的任务。如果服务在调用时已经启动,Ansible 处理程序会做什么?

【问题讨论】:

    标签: ansible


    【解决方案1】:

    这取决于您用于重新启动服务的模块和定义。通常(例如service 模块)当服务已经启动并且您指定state: started 时,什么都不会发生

    在处理程序中,您通常希望使用state: restarted,这将确保在处理程序运行时重新启动服务。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-08
      • 1970-01-01
      • 1970-01-01
      • 2022-10-05
      相关资源
      最近更新 更多