Update yum/dnf module docs to include version comp (#72763)

* Update yum/dnf module docs to include version comp

Fixes #61234

Signed-off-by: Adam Miller <admiller@redhat.com>

* fix up docs syntax to sanity tests are happy

Signed-off-by: Adam Miller <admiller@redhat.com>
This commit is contained in:
Adam Miller 2020-12-11 09:31:19 -06:00 committed by GitHub
parent e7dee73774
commit 0044091a05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- Add yum/dnf version comparison documentation for package install

View file

@ -25,6 +25,7 @@ options:
When using state=latest, this can be '*' which means run: dnf -y update. When using state=latest, this can be '*' which means run: dnf -y update.
You can also pass a url or a local path to a rpm file. You can also pass a url or a local path to a rpm file.
To operate on several packages this can accept a comma separated string of packages or a list of packages." To operate on several packages this can accept a comma separated string of packages or a list of packages."
- Comparison operators for package version are valid here C(>), C(<), C(>=), C(<=). Example - C(name>=1.0)
required: true required: true
aliases: aliases:
- pkg - pkg
@ -250,6 +251,11 @@ EXAMPLES = '''
name: httpd name: httpd
state: latest state: latest
- name: Install Apache >= 2.4
dnf:
name: httpd>=2.4
state: present
- name: Install the latest version of Apache and MariaDB - name: Install the latest version of Apache and MariaDB
dnf: dnf:
name: name:

View file

@ -33,6 +33,7 @@ options:
name: name:
description: 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).
- Comparison operators for package version are valid here C(>), C(<), C(>=), C(<=). Example - C(name>=1.0)
- If a previous version is specified, the task also needs to turn C(allow_downgrade) on. - 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. See the C(allow_downgrade) documentation for caveats with downgrading packages.
- When using state=latest, this can be C('*') which means run C(yum -y update). - When using state=latest, this can be C('*') which means run C(yum -y update).
@ -277,6 +278,11 @@ EXAMPLES = '''
name: httpd name: httpd
state: latest state: latest
- name: Install Apache >= 2.4
yum:
name: httpd>=2.4
state: present
- name: Install a list of packages (suitable replacement for 2.11 loop deprecation warning) - name: Install a list of packages (suitable replacement for 2.11 loop deprecation warning)
yum: yum:
name: name: