yum_repository模块管理远程主机上的yum仓库
]# ansible all -m yum_repository -a ‘name=aliepel baseurl=https://mirrors.aliyun.com/epel/7/x86_64/ enabled=yes gpgcheck=yes gpgcakey=https://mirrors.aliyun.com/epel/RPM-GPG-KEY-EPEL-7 state=present file=AlicloudEpel‘
]# ansible all -m yum_repository -a ‘file=AlicloudEpel name=aliepel state=absent‘
原文:https://www.cnblogs.com/wanwz/p/12929850.html