2017-11-21 09:40:58 +01:00
|
|
|
- block:
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Install dinginessentail-1.0-1
|
2017-11-21 09:40:58 +01:00
|
|
|
dnf:
|
2019-08-07 20:26:55 +02:00
|
|
|
name: dinginessentail-1.0-1
|
2017-11-21 09:40:58 +01:00
|
|
|
state: present
|
|
|
|
register: dnf_result
|
|
|
|
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Check dinginessentail with rpm
|
|
|
|
shell: rpm -q dinginessentail
|
2017-11-21 09:40:58 +01:00
|
|
|
register: rpm_result
|
|
|
|
|
|
|
|
- name: Verify installation
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- "dnf_result.changed"
|
2019-08-07 20:26:55 +02:00
|
|
|
- "rpm_result.stdout.startswith('dinginessentail-1.0-1')"
|
2017-11-21 09:40:58 +01:00
|
|
|
|
|
|
|
- name: Verify dnf module outputs
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- "'results' in dnf_result"
|
|
|
|
# ============================================================================
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Install dinginessentail-1.0-1 again
|
2017-11-21 09:40:58 +01:00
|
|
|
dnf:
|
2019-08-07 20:26:55 +02:00
|
|
|
name: dinginessentail-1.0-1
|
2017-11-21 09:40:58 +01:00
|
|
|
state: present
|
|
|
|
register: dnf_result
|
|
|
|
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Check dinginessentail with rpm
|
|
|
|
shell: rpm -q dinginessentail
|
2017-11-21 09:40:58 +01:00
|
|
|
register: rpm_result
|
|
|
|
|
|
|
|
- name: Verify installation
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- "not dnf_result.changed"
|
2019-08-07 20:26:55 +02:00
|
|
|
- "rpm_result.stdout.startswith('dinginessentail-1.0-1')"
|
2017-11-21 09:40:58 +01:00
|
|
|
|
|
|
|
- name: Verify dnf module outputs
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- "'msg' in dnf_result"
|
|
|
|
# ============================================================================
|
2020-01-17 17:22:06 +01:00
|
|
|
- name: Install dinginessentail again (noop, module is idempotent)
|
|
|
|
dnf:
|
|
|
|
name: dinginessentail
|
|
|
|
state: present
|
|
|
|
register: dnf_result
|
|
|
|
|
|
|
|
- name: Check dinginessentail with rpm
|
|
|
|
shell: rpm -q dinginessentail
|
|
|
|
register: rpm_result
|
|
|
|
|
|
|
|
- name: Verify installation
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
# No upgrade happened to 1.1.1
|
|
|
|
- "not dnf_result.changed"
|
|
|
|
# Old version still installed
|
|
|
|
- "rpm_result.stdout.startswith('dinginessentail-1.0-1')"
|
|
|
|
# ============================================================================
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Install dinginessentail-1:1.0-2
|
2017-11-21 09:40:58 +01:00
|
|
|
dnf:
|
2019-08-07 20:26:55 +02:00
|
|
|
name: "dinginessentail-1:1.0-2.{{ ansible_architecture }}"
|
2017-11-21 09:40:58 +01:00
|
|
|
state: present
|
|
|
|
register: dnf_result
|
|
|
|
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Check dinginessentail with rpm
|
|
|
|
shell: rpm -q dinginessentail
|
2017-11-21 09:40:58 +01:00
|
|
|
register: rpm_result
|
|
|
|
|
|
|
|
- name: Verify installation
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- "dnf_result.changed"
|
2019-08-07 20:26:55 +02:00
|
|
|
- "rpm_result.stdout.startswith('dinginessentail-1.0-2')"
|
2017-11-21 09:40:58 +01:00
|
|
|
|
|
|
|
- name: Verify dnf module outputs
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- "'results' in dnf_result"
|
|
|
|
# ============================================================================
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Update to the latest dinginessentail
|
2017-11-21 09:40:58 +01:00
|
|
|
dnf:
|
2019-08-07 20:26:55 +02:00
|
|
|
name: dinginessentail
|
2017-11-21 09:40:58 +01:00
|
|
|
state: latest
|
|
|
|
register: dnf_result
|
|
|
|
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Check dinginessentail with rpm
|
|
|
|
shell: rpm -q dinginessentail
|
2017-11-21 09:40:58 +01:00
|
|
|
register: rpm_result
|
|
|
|
|
|
|
|
- name: Verify installation
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- "dnf_result.changed"
|
2019-08-07 20:26:55 +02:00
|
|
|
- "rpm_result.stdout.startswith('dinginessentail-1.1-1')"
|
2017-11-21 09:40:58 +01:00
|
|
|
|
|
|
|
- name: Verify dnf module outputs
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- "'results' in dnf_result"
|
|
|
|
# ============================================================================
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Install dinginessentail-1.0-1 from a file (downgrade)
|
2017-11-21 09:40:58 +01:00
|
|
|
dnf:
|
2019-08-07 20:26:55 +02:00
|
|
|
name: "{{ repodir }}/dinginessentail-1.0-1.{{ ansible_architecture }}.rpm"
|
2017-11-21 09:40:58 +01:00
|
|
|
state: present
|
2018-08-27 19:17:47 +02:00
|
|
|
allow_downgrade: True
|
2020-08-31 16:47:38 +02:00
|
|
|
disable_gpg_check: True
|
2017-11-21 09:40:58 +01:00
|
|
|
register: dnf_result
|
|
|
|
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Check dinginessentail with rpm
|
|
|
|
shell: rpm -q dinginessentail
|
2017-11-21 09:40:58 +01:00
|
|
|
register: rpm_result
|
|
|
|
|
|
|
|
- name: Verify installation
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- "dnf_result.changed"
|
2019-08-07 20:26:55 +02:00
|
|
|
- "rpm_result.stdout.startswith('dinginessentail-1.0-1')"
|
2017-11-21 09:40:58 +01:00
|
|
|
|
|
|
|
- name: Verify dnf module outputs
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- "'results' in dnf_result"
|
|
|
|
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Remove dinginessentail
|
2017-11-21 09:40:58 +01:00
|
|
|
dnf:
|
2019-08-07 20:26:55 +02:00
|
|
|
name: dinginessentail
|
2017-11-21 09:40:58 +01:00
|
|
|
state: absent
|
|
|
|
# ============================================================================
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Install dinginessentail-1.0-1 from a file
|
2017-11-21 09:40:58 +01:00
|
|
|
dnf:
|
2019-08-07 20:26:55 +02:00
|
|
|
name: "{{ repodir }}/dinginessentail-1.0-1.{{ ansible_architecture }}.rpm"
|
2017-11-21 09:40:58 +01:00
|
|
|
state: present
|
2020-08-31 16:47:38 +02:00
|
|
|
disable_gpg_check: True
|
2017-11-21 09:40:58 +01:00
|
|
|
register: dnf_result
|
|
|
|
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Check dinginessentail with rpm
|
|
|
|
shell: rpm -q dinginessentail
|
2017-11-21 09:40:58 +01:00
|
|
|
register: rpm_result
|
|
|
|
|
|
|
|
- name: Verify installation
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- "dnf_result.changed"
|
2019-08-07 20:26:55 +02:00
|
|
|
- "rpm_result.stdout.startswith('dinginessentail-1.0-1')"
|
2017-11-21 09:40:58 +01:00
|
|
|
|
|
|
|
- name: Verify dnf module outputs
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- "'results' in dnf_result"
|
|
|
|
# ============================================================================
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Install dinginessentail-1.0-1 from a file again
|
2017-11-21 09:40:58 +01:00
|
|
|
dnf:
|
2019-08-07 20:26:55 +02:00
|
|
|
name: "{{ repodir }}/dinginessentail-1.0-1.{{ ansible_architecture }}.rpm"
|
2017-11-21 09:40:58 +01:00
|
|
|
state: present
|
2020-08-31 16:47:38 +02:00
|
|
|
disable_gpg_check: True
|
2017-11-21 09:40:58 +01:00
|
|
|
register: dnf_result
|
|
|
|
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Check dinginessentail with rpm
|
|
|
|
shell: rpm -q dinginessentail
|
2017-11-21 09:40:58 +01:00
|
|
|
register: rpm_result
|
|
|
|
|
|
|
|
- name: Verify installation
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- "not dnf_result.changed"
|
2019-08-07 20:26:55 +02:00
|
|
|
- "rpm_result.stdout.startswith('dinginessentail-1.0-1')"
|
2017-11-21 09:40:58 +01:00
|
|
|
# ============================================================================
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Install dinginessentail-1.0-2 from a file
|
2017-11-21 09:40:58 +01:00
|
|
|
dnf:
|
2019-08-07 20:26:55 +02:00
|
|
|
name: "{{ repodir }}/dinginessentail-1.0-2.{{ ansible_architecture }}.rpm"
|
2017-11-21 09:40:58 +01:00
|
|
|
state: present
|
2020-08-31 16:47:38 +02:00
|
|
|
disable_gpg_check: True
|
2017-11-21 09:40:58 +01:00
|
|
|
register: dnf_result
|
|
|
|
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Check dinginessentail with rpm
|
|
|
|
shell: rpm -q dinginessentail
|
2017-11-21 09:40:58 +01:00
|
|
|
register: rpm_result
|
|
|
|
|
|
|
|
- name: Verify installation
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- "dnf_result.changed"
|
2019-08-07 20:26:55 +02:00
|
|
|
- "rpm_result.stdout.startswith('dinginessentail-1.0-2')"
|
2017-11-21 09:40:58 +01:00
|
|
|
|
|
|
|
- name: Verify dnf module outputs
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- "'results' in dnf_result"
|
|
|
|
# ============================================================================
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Install dinginessentail-1.0-2 from a file again
|
2017-11-21 09:40:58 +01:00
|
|
|
dnf:
|
2019-08-07 20:26:55 +02:00
|
|
|
name: "{{ repodir }}/dinginessentail-1.0-2.{{ ansible_architecture }}.rpm"
|
2017-11-21 09:40:58 +01:00
|
|
|
state: present
|
2020-08-31 16:47:38 +02:00
|
|
|
disable_gpg_check: True
|
2017-11-21 09:40:58 +01:00
|
|
|
register: dnf_result
|
|
|
|
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Check dinginessentail with rpm
|
|
|
|
shell: rpm -q dinginessentail
|
2017-11-21 09:40:58 +01:00
|
|
|
register: rpm_result
|
|
|
|
|
|
|
|
- name: Verify installation
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- "not dnf_result.changed"
|
2019-08-07 20:26:55 +02:00
|
|
|
- "rpm_result.stdout.startswith('dinginessentail-1.0-2')"
|
2017-11-21 09:40:58 +01:00
|
|
|
# ============================================================================
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Remove dinginessentail
|
2017-11-21 09:40:58 +01:00
|
|
|
dnf:
|
2019-08-07 20:26:55 +02:00
|
|
|
name: dinginessentail
|
2017-11-21 09:40:58 +01:00
|
|
|
state: absent
|
|
|
|
|
|
|
|
- name: Try to install incompatible arch
|
|
|
|
dnf:
|
2019-08-07 20:26:55 +02:00
|
|
|
name: "{{ repodir_ppc64 }}/dinginessentail-1.0-1.ppc64.rpm"
|
2017-11-21 09:40:58 +01:00
|
|
|
state: present
|
|
|
|
register: dnf_result
|
|
|
|
ignore_errors: yes
|
|
|
|
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Check dinginessentail with rpm
|
|
|
|
shell: rpm -q dinginessentail
|
2017-11-21 09:40:58 +01:00
|
|
|
register: rpm_result
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: Verify installation
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- "rpm_result.rc == 1"
|
|
|
|
- "not dnf_result.changed"
|
|
|
|
- "dnf_result is failed"
|
|
|
|
# ============================================================================
|
2019-01-04 17:37:59 +01:00
|
|
|
|
2019-08-07 20:26:55 +02:00
|
|
|
# Should install dinginessentail-with-weak-dep and dinginessentail-weak-dep
|
2019-01-04 17:37:59 +01:00
|
|
|
- name: Install package with defaults
|
|
|
|
dnf:
|
2019-08-07 20:26:55 +02:00
|
|
|
name: dinginessentail-with-weak-dep
|
2019-01-04 17:37:59 +01:00
|
|
|
state: present
|
|
|
|
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Check if dinginessentail-with-weak-dep is installed
|
|
|
|
shell: rpm -q dinginessentail-with-weak-dep
|
2019-01-04 17:37:59 +01:00
|
|
|
register: rpm_main_result
|
|
|
|
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Check if dinginessentail-weak-dep is installed
|
|
|
|
shell: rpm -q dinginessentail-weak-dep
|
2019-01-04 17:37:59 +01:00
|
|
|
register: rpm_weak_result
|
|
|
|
|
|
|
|
- name: Verify install with weak deps
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- rpm_main_result.rc == 0
|
|
|
|
- rpm_weak_result.rc == 0
|
|
|
|
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Uninstall dinginessentail weak dep packages
|
2019-01-04 17:37:59 +01:00
|
|
|
dnf:
|
|
|
|
name:
|
2019-08-07 20:26:55 +02:00
|
|
|
- dinginessentail-with-weak-dep
|
|
|
|
- dinginessentail-weak-dep
|
2019-01-04 17:37:59 +01:00
|
|
|
state: absent
|
|
|
|
|
|
|
|
- name: Install package with weak deps but skip weak deps
|
|
|
|
dnf:
|
2019-08-07 20:26:55 +02:00
|
|
|
name: dinginessentail-with-weak-dep
|
2019-01-04 17:37:59 +01:00
|
|
|
install_weak_deps: False
|
|
|
|
state: present
|
|
|
|
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Check if dinginessentail-with-weak-dep is installed
|
|
|
|
shell: rpm -q dinginessentail-with-weak-dep
|
2019-01-04 17:37:59 +01:00
|
|
|
register: rpm_main_result
|
|
|
|
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Check if dinginessentail-weak-dep is installed
|
|
|
|
shell: rpm -q dinginessentail-weak-dep
|
2019-01-04 17:37:59 +01:00
|
|
|
register: rpm_weak_result
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: Verify install without weak deps
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- rpm_main_result.rc == 0
|
|
|
|
- rpm_weak_result.rc == 1 # the weak dependency shouldn't be installed
|
2019-05-14 23:34:11 +02:00
|
|
|
|
|
|
|
# https://github.com/ansible/ansible/issues/55938
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Install dinginessentail-*
|
2019-05-14 23:34:11 +02:00
|
|
|
dnf:
|
2019-08-07 20:26:55 +02:00
|
|
|
name: dinginessentail-*
|
2019-05-14 23:34:11 +02:00
|
|
|
state: present
|
|
|
|
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Uninstall dinginessentail-*
|
2019-05-14 23:34:11 +02:00
|
|
|
dnf:
|
2019-08-07 20:26:55 +02:00
|
|
|
name: dinginessentail-*
|
2019-05-14 23:34:11 +02:00
|
|
|
state: absent
|
|
|
|
|
2019-08-07 20:26:55 +02:00
|
|
|
- name: Check if all dinginessentail packages are removed
|
|
|
|
shell: rpm -qa dinginessentail-* | wc -l
|
2019-05-14 23:34:11 +02:00
|
|
|
register: rpm_result
|
|
|
|
|
|
|
|
- name: Verify rpm result
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- rpm_result.stdout == '0'
|
2017-11-21 09:40:58 +01:00
|
|
|
always:
|
|
|
|
- name: Clean up
|
2018-01-09 01:36:53 +01:00
|
|
|
dnf:
|
2019-01-04 17:37:59 +01:00
|
|
|
name:
|
2019-08-07 20:26:55 +02:00
|
|
|
- dinginessentail
|
|
|
|
- dinginessentail-with-weak-dep
|
|
|
|
- dinginessentail-weak-dep
|
2017-11-21 09:40:58 +01:00
|
|
|
state: absent
|