mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
yum: allow for downgrade using rpm file (#31647)
This commit is contained in:
parent
1d86205933
commit
ee6ba5d590
2 changed files with 40 additions and 3 deletions
|
@ -499,3 +499,36 @@
|
|||
- "'rc' in yum_result"
|
||||
- "'results' in yum_result"
|
||||
# ============================================================================
|
||||
- name: Make sure latest foo is installed
|
||||
yum:
|
||||
name: foo
|
||||
state: latest
|
||||
|
||||
- name: Downgrade foo using rpm file
|
||||
yum:
|
||||
name: "{{ repodir }}/foo-1.0-1.{{ ansible_architecture }}.rpm"
|
||||
state: present
|
||||
allow_downgrade: yes
|
||||
register: yum_result
|
||||
|
||||
- name: Check foo with rpm
|
||||
shell: rpm -q foo
|
||||
register: rpm_result
|
||||
|
||||
- name: Verify installation
|
||||
assert:
|
||||
that:
|
||||
- "rpm_result.rc == 0"
|
||||
- "yum_result.rc == 0"
|
||||
- "yum_result.changed"
|
||||
- "not yum_result|failed"
|
||||
- "rpm_result.stdout.startswith('foo-1.0-1')"
|
||||
|
||||
- name: Verify yum module outputs
|
||||
assert:
|
||||
that:
|
||||
- "'changed' in yum_result"
|
||||
- "'msg' in yum_result"
|
||||
- "'rc' in yum_result"
|
||||
- "'results' in yum_result"
|
||||
# ============================================================================
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue