mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
yum: fix 'package == version' syntax (#47744)
This commit is contained in:
@@ -556,3 +556,35 @@
|
||||
name: foo
|
||||
state: absent
|
||||
when: not (ansible_distribution == "Fedora" and ansible_distribution_major_version|int < 26)
|
||||
|
||||
# https://github.com/ansible/ansible/issues/47689
|
||||
- block:
|
||||
- name: Install foo == 1.0
|
||||
yum:
|
||||
name: "foo == 1.0"
|
||||
state: present
|
||||
register: yum_result
|
||||
|
||||
- name: Check foo with rpm
|
||||
shell: rpm -q foo
|
||||
register: rpm_result
|
||||
|
||||
- name: Verify installation
|
||||
assert:
|
||||
that:
|
||||
- "yum_result.changed"
|
||||
- "rpm_result.stdout.startswith('foo-1.0-1')"
|
||||
|
||||
- name: Verify yum module outputs
|
||||
assert:
|
||||
that:
|
||||
- "'msg' in yum_result"
|
||||
- "'rc' in yum_result"
|
||||
- "'results' in yum_result"
|
||||
always:
|
||||
- name: Clean up
|
||||
yum:
|
||||
name: foo
|
||||
state: absent
|
||||
|
||||
when: ansible_pkg_mgr == 'yum'
|
||||
|
||||
Reference in New Issue
Block a user