mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-21 03:23:59 -07:00
Add yum module to examples + playbook examples
This commit is contained in:
parent
8bf7e79ee3
commit
a13def0fbe
8 changed files with 36 additions and 9 deletions
|
@ -60,10 +60,6 @@ template engine, using 'facter' and 'ohai' prefixes for each.
|
|||
Managing Packages
|
||||
`````````````````
|
||||
|
||||
Ensure a package is at the latest version::
|
||||
|
||||
ansible webservers -m yum -a "pkg=acme state=latest"
|
||||
|
||||
Ensure a package is installed, but don't update it::
|
||||
|
||||
ansible webservers -m yum -a "pkg=acme state=installed"
|
||||
|
@ -72,6 +68,10 @@ Ensure a package is installed to a specific version::
|
|||
|
||||
ansible-webservers -m yum -a "pkg=acme-1.5 state=installed"
|
||||
|
||||
Ensure a package is at the latest version::
|
||||
|
||||
ansible webservers -m yum -a "pkg=acme state=latest"
|
||||
|
||||
Ensure a package is not installed:
|
||||
|
||||
ansible-webservers -m yum -a "pkg=acme state=removed"
|
||||
|
|
|
@ -42,6 +42,8 @@ server group, then more commands back on the webservers group, etc::
|
|||
user: root
|
||||
tasks:
|
||||
- include: base.yml somevar=3 othervar=4
|
||||
- name: ensure apache is installed
|
||||
action: yum pkg=httpd state=installed
|
||||
- name: write the apache config file
|
||||
action: template src=/srv/httpd.j2 dest=/etc/httpd.conf
|
||||
notify:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue