yum: fix reporting group changes in check_mode (#28331)

This commit is contained in:
Martin Krizek 2017-08-22 16:35:23 -04:00 committed by Sam Doran
commit 711ae03845
2 changed files with 33 additions and 3 deletions

View file

@ -255,7 +255,7 @@
state: present
register: yum_result
- name: verify nothing changed
- name: verify sos is installed
assert:
that:
- "yum_result.rc == 0"
@ -269,6 +269,25 @@
- "'rc' in yum_result"
- "'results' in yum_result"
- name: try to install the group again, with --check to check 'changed'
yum:
name: "@Development Tools"
state: present
check_mode: yes
register: yum_result
- name: verify nothing changed
assert:
that:
- "not yum_result.changed"
- name: verify yum module outputs
assert:
that:
- "'changed' in yum_result"
- "'msg' in yum_result"
- "'results' in yum_result"
- name: try to install non existing group
yum:
name: "@non-existing-group"