yum - Manages packages with the yum package manager — Ansible ...
docs.ansible.com › ansible › 2Dec 01, 2020 · -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: install one specific version of Apache yum: name: httpd-2.2.29-1.4.amzn1 state: present-name: upgrade all packages yum: name: '*' state: latest-name: upgrade all packages, excluding kernel & foo related packages yum: name: '*' state ...
Add a repo and install a package the Ansible way | Enable ...
www.redhat.com › sysadmin › install-ansible-wayAug 04, 2020 · $ ansible all -m command -a 'yum --enablerepo=rhel-7-server-rpms install git' The command module runs a given command in parallel on the hosts specified by a host pattern (all in this case). Add a new repo and install a package. You may have noticed that I used the rhel-7-server-rpms repo in the examples above. It already exists in my yum configuration. In some cases, there is no configured repo, so I must specify one to use it.