$ ansible-doc yum
Installs, upgrade, removes, and lists packages and groups with the
`yum' package manager.
Options (= is mandatory):
The remote yum configuration file to use for the transaction.
Whether to disable the GPG checking of signatures of packages
being installed. Has an effect only if state is `present' or
`latest'. (Choices: yes, no)
`repoid' of repositories to disable for the install/update
operation These repos will not persist beyond the transaction
Multiple repos separated with a ','
Repoid of repositories to enable for the install/update
operation. These repos will not persist beyond the transaction
multiple repos separated with a ','
Various (non-idempotent) commands for usage with
`/usr/bin/ansible' and `not' playbooks. See examples.
Package name, or package specifier with version, like
`name-1.0'. When using state=latest, this can be '*' which
means run: yum -y update. You can also pass a url or a local
path to a rpm file.
Whether to install (`present', `latest'), or remove (`absent')
a package. (Choices: present, latest, absent)
Requirements: yum, rpm
- name: install the latest version of Apache
yum: name=httpd state=latest
- name: remove the Apache package
yum: name=httpd state=removed
- name: install the latest version of Apache from the testing repo
yum: name=httpd enablerepo=testing state=installed
- name: upgrade all packages
yum: name=* state=latest
- name: install the nginx rpm from a remote repo
yum: name=http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm state=present
- name: install nginx rpm from a local file
yum: name=/usr/local/src/nginx-release-centos-6-0.el6.ngx.noarch.rpm state=present
- name: install the 'Development tools' package group
yum: name="@Development tools" state=present