yum - Manages packages with the yum package manager

Author:Seth Vidal

Synopsis

Installs, upgrade, removes, and lists packages and groups with the yum package manager.

Options

parameter required default choices comments
conf_file no
    The remote yum configuration file to use for the transaction. (added in Ansible 0.6)
    disable_gpg_check no no
    • yes
    • no
    Whether to disable the GPG checking of signatures of packages being installed. Has an effect only if state is present or latest. (added in Ansible 1.2)
    disablerepo no
      Repoid of repositories to disable for the install/update operation. These repos will not persist beyond the transaction. When specifying multiple repos, separate them with a ",". (added in Ansible 0.9)
      enablerepo no
        Repoid of repositories to enable for the install/update operation. These repos will not persist beyond the transaction. When specifying multiple repos, separate them with a ",". (added in Ansible 0.9)
        list no
          Various (non-idempotent) commands for usage with /usr/bin/ansible and not playbooks. See examples.
          name yes
            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.
            state no present
            • present
            • latest
            • absent
            Whether to install (present, latest), or remove (absent) a package.

            Note

            Requires yum

            Note

            Requires rpm

            Examples


            - name: install the latest version of Apache
              yum: name=httpd state=latest
            
            - name: remove the Apache package
              yum: name=httpd state=absent
            
            - name: install the latest version of Apache from the testing repo
              yum: name=httpd enablerepo=testing state=present
            
            - 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
            

            Table Of Contents

            Previous topic

            urpmi - Urpmi manager

            Next topic

            zypper - Manage packages on SuSE and openSuSE