Ansible 之 通过yum模块安装软件
一、安装Nginx #可通过ansible-doc yum 查看对应的帮助文档 [root@Ansible ~]# ansible test -m command -a "wget -O /etc/yum.repos.d/epel.repo" #下载epel源 [root@Ansible ~]# ansible test -m command -a "yum clean all" -u cedar -b [root@Ansible ~]# ansible test -m command -a "yum makecache" -u cedar -b [root@Ansible ~]# ansible test -m command -a "yum info nginx" -u cedar -b [root@Ansible ~]# ansible test -m yum -a "name=nginx state=present" -u cedar -b 10.3.153.8 | CHANGED => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python" }, "changed": true, "changes": { "installed": [ "nginx" ] }, [root