Ansible yum模块 主要用于软件安装

目录

  • [实例 安装一个tree](#实例 安装一个tree)
    • [实例卸载一个 tree](#实例卸载一个 tree)

选项

name=   #所安装的包的名称

state=  #present--->安装, latest--->安装最新的, absent---> 卸载软件。

update_cache  #强制更新yum的缓存

conf_file  #指定远程yum安装时所依赖的配置文件(安装本地已有的包)。

disable_gpg_check  #是否禁止GPG checking,只用于presentor latest

disablerepo  #临时禁止使用yum库。 只用于安装或更新时。

enablerepo   #临时使用的yum库。只用于安装或更新时。

实例 安装一个tree

这里安装一个htop 的包

sh 复制代码
ansible slave -m yum -a 'name=tree state=present'

可以看到这两个已经安装 成功了

实例卸载一个 tree

sh 复制代码
ansible slave -m yum -a 'name=tree state=absent'

这里是卸载了一个 tree 工具

有进度条则表示删除成功


yum 模块完结

相关推荐
风清再凯1 天前
自动化工具ansible,以及playbook剧本
运维·自动化·ansible
IT乌鸦坐飞机1 天前
ansible部署数据库服务随机启动并创建用户和设置用户有完全权限
数据库·ansible·centos7
遇见火星14 天前
如何使用Ansible一键部署MinIO集群?
ansible
粥周粥14 天前
ANSIBLE
ansible
码农101号14 天前
Linux中ansible模块补充和playbook讲解
linux·运维·ansible
码农101号14 天前
Linux的Ansible软件基础使用讲解和ssh远程连接
ansible
烟雨书信15 天前
ANSIBLE运维自动化管理端部署
运维·自动化·ansible
碎碎-li15 天前
ANSIBLE(运维自动化)
运维·自动化·ansible
@donshu@18 天前
Linux运维-ansible-python开发-获取inventroy信息
linux·运维·ansible
Kendra91921 天前
Ansible
ansible