ansible 使用 yum 模块来安装软件包,使用 service 模块来启动软件:

[root@localhost ~]$ ansible 192.168.119.134 -m yum -a "name=httpd"                                  # 安装软件包
[root@localhost ~]$ ansible 192.168.119.134 -m yum -a "name=httpd state=removed"                    # 卸载软件包
[root@localhost ~]$ ansible 192.168.119.134 -m service -a "name=httpd state=started enabled=yes"    # 启动并设置成开机启动

 

 

 

 

    

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2021-08-07
  • 2021-11-21
  • 2022-01-11
  • 2021-04-16
猜你喜欢
  • 2021-12-11
  • 2022-12-23
  • 2021-09-22
  • 2021-12-23
  • 2021-04-14
相关资源
相似解决方案