mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 14:20:22 -07:00
doc: apt, yum: add example with package lists (#38333)
This commit is contained in:
parent
fa8b047039
commit
af3598343d
2 changed files with 24 additions and 6 deletions
|
@ -25,7 +25,7 @@ description:
|
|||
options:
|
||||
name:
|
||||
description:
|
||||
- A package name , or package specifier with version, like C(name-1.0).
|
||||
- A package name or package specifier with version, like C(name-1.0).
|
||||
- If a previous version is specified, the task also needs to turn C(allow_downgrade) on.
|
||||
See the C(allow_downgrade) documentation for caveats with downgrading packages.
|
||||
- When using state=latest, this can be '*' which means run C(yum -y update).
|
||||
|
@ -180,6 +180,14 @@ EXAMPLES = '''
|
|||
name: httpd
|
||||
state: latest
|
||||
|
||||
- name: ensure a list of packages installed
|
||||
yum:
|
||||
name: "{{ packages }}"
|
||||
vars:
|
||||
packages:
|
||||
- httpd
|
||||
- httpd-tools
|
||||
|
||||
- name: remove the Apache package
|
||||
yum:
|
||||
name: httpd
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue