Ansible使用service模块管理系统服务

确认某个服务在所有的webservers上都已经启动:

ansible webservers -m service -a "name=httpd state=started"

或是在所有的webservers上重启某个服务(译者注:可能是确认已重启的状态?):

ansible webservers -m service -a "name=httpd state=restarted"

确认某个服务已经停止:

ansible webservers -m service -a "name=httpd state=stopped"
posted @ 2020-10-28 11:50  Varden  阅读(588)  评论(0编辑  收藏  举报