malay bhayani
malay bhayani

Reputation: 1

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 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?

Upvotes: 0

Views: 57

Answers (1)

Simon
Simon

Reputation: 4485

That depends on what module and what definition you are using to restart the service. Typically (such with the service module) when a service is already started and you specify state: started, then nothing happens.

In handlers, you typically want to use state: restarted, which will make sure a service is restarted when the handler runs.

Upvotes: 1

Related Questions