Ansible安装模块yum(学习笔记六)
2018-03-22 本文已影响3人
SkTj
yum:安装软件、删除软件、升级所有软件、RPM安装。yum模块时针对centos,如果时ubuntu,则换成apt模块
-
name: 安装最新版本的apache
yum: name=httpd state=latest -
name: 移除apache
yum: name=httpd state=absent -
name: 安装一个特殊版本的apache
yum: name=httpd-2.2.29-1.4.amzn1 state=present -
name: 升级所有的软件包
yum: name=* state=latest -
name: 从一个远程yum仓库安装nginx
yum: name=http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm state=present -
name: 从本地仓库安装nginx
yum: name=/usr/local/src/nginx-release-centos-6-0.el6.ngx.noarch.rpm state=present -
name: 安装整个Development tools相关的软件包
yum: name="@Development tools" state=present