ansible批量自动化管理工具-service模块专题(四)

开启nginx服务:

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

停止nginx服务:

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

重启nginx服务:

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

重新加载httpd服务:

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

开启nginx服务,同时设置开机自动启动:

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

猜你喜欢

转载自blog.csdn.net/weixin_43010385/article/details/113060374
今日推荐