Ansible batch automated management tool-service module topic (4)

Open nginx service:

ansible all -m service -a ‘name=nginx state=started’

Stop nginx service:

ansible all -m service -a ‘name=nginx state=stopped’

Restart the nginx service:

ansible all -m service -a ‘name=nginx state=restarted’

Reload the httpd service:

ansible all -m service -a ‘name=httpd state=reloaded’

Start the nginx service, and set it to start automatically after booting:

ansible all -m service -a ‘name=nginx state=started enabled=yes’

Guess you like

Origin blog.csdn.net/weixin_43010385/article/details/113060374