后来,好多人代替了好多人☁️|

little小新

园龄:2年6个月粉丝:8关注:0

7、ansible-Ad-Hoc-点对点模式--m service-服务模块(启动、停止、重启)

启动服务:

ansible webserver -m service -a 'name=httpd state=started'

设置开机自启

ansible webserver -m service -a 'name=httpd state=started enabled='yes''
 
  ·· 如果enabled=no 表示禁止开机自启

 停止服务

ansible webserver -m service -a 'name=httpd state=stopped'

重启服务

ansible webserver -m service -a 'name=httpd state=restarted'

 

本文作者:little小新

本文链接:https://www.cnblogs.com/littlecc/p/17436121.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   little小新  阅读(10)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起