Ansible常用模块-yum模块

yum模块

name 必选 指定安装包名

state 执行命令  present  installed removed latest absent    

  其中installed and present等效  latest标志安装yum中最新版本,absent and removed 等效 表示删除安装包

disable_gpg_check 用于禁用rmp包的公钥gpg验证,默认值no  表示不做验证

enablerepo   用于指定安装软件包是临时启用的yum元

disablerepo 用于指定安装软件包是临时禁止用的yum元

测试用例

ansible xxx.xxx.xxx.xxx -m yum -a "state=installed name=readline-devel"
ansible xxx.xxx.xxx.xxx -m yum -a "state=removed name=tree"

猜你喜欢

转载自www.cnblogs.com/cherylgi/p/13365444.html