???紵 发表于 2018-7-30 10:03:40

3.6-ansible安装rpm包管理服务

  Ansible安装rpm包/管理服务
  * ansible testhost -m yum -a "name=httpd"   不支持name=vim*等通配符
  在name后面还可以加上state=installed
  * ansible testhost -m service -a "name=httpd state=started enabled=yes" 作用是,设置服务开机启动。相当于chkconfig httpd on一样。
  这里的name是centos系统里的服务名,可以通过chkconfig --list查到。state有started,stopped,restarted,reloaded等
  * Ansible文档的使用
  ansible-doc -l   列出所有的模块
  ansible-doc cron查看指定模块的文档
  ansible-doc service 查看指定模块相关的参数
页: [1]
查看完整版本: 3.6-ansible安装rpm包管理服务