1. 程式人生 > >Ansible 安裝和管理服務

Ansible 安裝和管理服務

ansible 使用 yum 模組來安裝軟體包,使用 service 模組來啟動軟體:

[[email protected] ~]$ ansible 192.168.119.134 -m yum -a "name=httpd"                                  # 安裝軟體包
[[email protected] ~]$ ansible 192.168.119.134 -m yum -a "name=httpd state=removed"                    # 解除安裝軟體包
[[email protected]
~]$ ansible 192.168.119.134 -m service -a "name=httpd state=started enabled=yes" # 啟動並設定成開機啟動