Ansible 2 · Ad-hoc commands

Restart a service

Restart a service on a group of hosts.

ansible webservers -i inventory.ini -m service -a "name=nginx state=restarted" --become

Official Ansible 2 documentation

More ad-hoc commands commands

All ad-hoc commands commands · Ansible 2 cheatsheet

Was this page helpful?