1、啟動服務:
ansible all -m service -a "name=nagios state=started"
2、停止服務:
ansible all -m service -a "name=nagios state=stopped"
3、重新開機服務:
ansible all -m service -a "name=nagios state=restarted"
4、開機啟動:
ansible all -m service -a "name=nagios enable=yes"
5、停止開機啟動:
ansible all -m service -a "name=nagios enable=no"
6、帶參數啟動:
ansible all -m service -a "name=network state=restarted args=eth0"