ansible/test/integration/targets/yum/tasks/yum_group_remove.yml
Adam Miller 397febd343 YUM4/DNF compatibility via yum action plugin (#44322)
* YUM4/DNF compatibility via yum action plugin

DNF does not natively support allow_downgrade as an option, instead
that is always the default (not configurable by the administrator)
so it had to be implemented

 - Fixed group actions in check mode to report correct changed state
 - Better error handling for depsolve and transaction errors in DNF
 - Fixed group action idempotent transactions
 - Add use_backend to yum module/action plugin
 - Fix dnf handling of autoremove (didn't used to work nor had a
   default value specified, now does work and matches default
   behavior of yum)
 - Enable installroot tests for yum4(dnf) integration testing, dnf
   backend now supports that
 - Switch from zip to bc for certain package install/remove test
   cases in yum integration tests. The dnf depsolver downgrades
   python when you uninstall zip which alters the test environment
   and we have no control over that.
 - Add changelog fragment
 - Return a pkg_mgr fact if it was not previously set.
2018-08-27 10:17:47 -07:00

150 lines
2.9 KiB
YAML

- name: install a group to test and yum-utils
yum:
name: "{{ item }}"
state: present
with_items:
- "@Development Tools"
- yum-utils
when: ansible_pkg_mgr == "yum"
- name: install a group to test and dnf-utils
yum:
name: "{{ item }}"
state: present
with_items:
- "@Development Tools"
- dnf-utils
when: ansible_pkg_mgr == "dnf"
- name: check mode remove the group
yum:
name: "@Development Tools"
state: absent
check_mode: yes
register: yum_result
- name: verify changed
assert:
that:
- "yum_result.changed"
- name: verify yum module outputs
assert:
that:
- "'changed' in yum_result"
- "'results' in yum_result"
- name: remove the group
yum:
name: "@Development Tools"
state: absent
register: yum_result
- name: verify changed
assert:
that:
- "yum_result.rc == 0"
- "yum_result.changed"
- name: verify yum module outputs
assert:
that:
- "'changed' in yum_result"
- "'msg' in yum_result"
- "'results' in yum_result"
- name: remove the group again
yum:
name: "@Development Tools"
state: absent
register: yum_result
- name: verify 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: check mode remove the group again
yum:
name: "@Development Tools"
state: absent
check_mode: yes
register: yum_result
- name: verify changed
assert:
that:
- "not yum_result.changed"
- name: verify yum module outputs
assert:
that:
- "'changed' in yum_result"
- "'results' in yum_result"
- name: install a group and a package to test
yum:
name: "@Development Tools,sos"
state: present
register: yum_output
- name: check mode remove the group along with the package
yum:
name: "@Development Tools,sos"
state: absent
register: yum_result
check_mode: yes
- name: verify changed
assert:
that:
- "yum_result.changed"
- name: verify yum module outputs
assert:
that:
- "'changed' in yum_result"
- "'results' in yum_result"
- name: remove the group along with the package
yum:
name: "@Development Tools,sos"
state: absent
register: yum_result
- name: verify changed
assert:
that:
- "yum_result.changed"
- name: verify yum module outputs
assert:
that:
- "'changed' in yum_result"
- "'msg' in yum_result"
- "'results' in yum_result"
- name: check mode remove the group along with the package
yum:
name: "@Development Tools,sos"
state: absent
register: yum_result
check_mode: yes
- name: verify not changed
assert:
that:
- "not yum_result.changed"
- name: verify yum module outputs
assert:
that:
- "'changed' in yum_result"
- "'results' in yum_result"