阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

Ansible-yum_repository模块

171次阅读
没有评论

共计 1395 个字符,预计需要花费 4 分钟才能阅读完成。

一、yum_repository 模块

yum_repository 模块用于配置 yum 仓库。

https://docs.ansible.com/ansible/latest/modules/yum_repository_module.html

参数 说明
name 仓库名 name.repo 源的名称 [name]
description 描述
baseurl 包下载路径
gpgcheck= 1 or 0 包 gpg 验证
enabled = yes|no 是否开启本源
state= absent 删除源

增加一个 /etc/yum.repos.d/dvd.repo 配置文件

[root@manage01 ~]# ansible -m yum_repository group1 -a "name=dvd description=BaseOS baseurl=file:///mnt/BaseOS gpgcheck=0 enabled=yes" 192.168.98.203 | CHANGED => {"ansible_facts": {"discovered_interpreter_python": "/usr/libexec/platform-python" }, "changed": true, "repo": "dvd", "state": "present" } 192.168.98.201 | CHANGED => {"ansible_facts": {"discovered_interpreter_python": "/usr/libexec/platform-python" }, "changed": true, "repo": "dvd", "state": "present" } 192.168.98.202 | CHANGED => {"ansible_facts": {"discovered_interpreter_python": "/usr/libexec/platform-python" }, "changed": true, "repo": "dvd", "state": "present" }

删除某个 yum 源

[root@manage01 ~]# ansible -m yum_repository group1 -a "name=dvd state=absent" 192.168.98.203 | CHANGED => {"ansible_facts": {"discovered_interpreter_python": "/usr/libexec/platform-python" }, "changed": true, "repo": "dvd", "state": "absent" } 192.168.98.202 | CHANGED => {"ansible_facts": {"discovered_interpreter_python": "/usr/libexec/platform-python" }, "changed": true, "repo": "dvd", "state": "absent" } 192.168.98.201 | CHANGED => {"ansible_facts": {"discovered_interpreter_python": "/usr/libexec/platform-python" }, "changed": true, "repo": "dvd", "state": "absent" }

二、学习视频

视频:yum_repository 模块

正文完
星哥玩云-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-06-09发表,共计1395字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中