ansible service模块使用示例
生活随笔
收集整理的這篇文章主要介紹了
ansible service模块使用示例
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
示例一、啟動httpd服務
# ansible 192.168.85.251 -m service -a "name=httpd state=started" -i hosts
示例二、重載httpd服務
# ansible 192.168.85.251 -m service -a "name=httpd state=reloaded" -i hosts
示例三、重啟Httpd服務
ansible 192.168.85.251 -m service -a "name=httpd state=restarted" -i hosts
示例四、停止httpd服務
ansible 192.168.85.251 -m service -a "name=httpd state=stopped" -i hosts
示例五、 啟動httpd服務,并加入開機自啟
ansible 192.168.85.251 -m service -a "name=httpd state=started enabled=yes" -i hosts
總結(jié)
以上是生活随笔為你收集整理的ansible service模块使用示例的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: centos7 rpm方式离线安装mys
- 下一篇: kafka2.5.0创建主题topic命