|
|
|
@ -1,22 +1,27 @@
|
|
|
|
|
# Setup by setup_rpm_repo
|
|
|
|
|
- set_fact:
|
|
|
|
|
package1: dinginessentail
|
|
|
|
|
package2: dinginessentail-olive
|
|
|
|
|
|
|
|
|
|
# UNINSTALL
|
|
|
|
|
- name: uninstall sos
|
|
|
|
|
yum: name=sos state=removed
|
|
|
|
|
- name: uninstall {{ package1 }}
|
|
|
|
|
yum: name={{ package1 }} state=removed
|
|
|
|
|
register: yum_result
|
|
|
|
|
|
|
|
|
|
- name: check sos with rpm
|
|
|
|
|
shell: rpm -q sos
|
|
|
|
|
- name: check {{ package1 }} with rpm
|
|
|
|
|
shell: rpm -q {{ package1 }}
|
|
|
|
|
ignore_errors: True
|
|
|
|
|
register: rpm_result
|
|
|
|
|
|
|
|
|
|
- name: verify uninstallation of sos
|
|
|
|
|
- name: verify uninstallation of {{ package1 }}
|
|
|
|
|
assert:
|
|
|
|
|
that:
|
|
|
|
|
- "yum_result is success"
|
|
|
|
|
- "rpm_result is failed"
|
|
|
|
|
|
|
|
|
|
# UNINSTALL AGAIN
|
|
|
|
|
- name: uninstall sos again in check mode
|
|
|
|
|
yum: name=sos state=removed
|
|
|
|
|
- name: uninstall {{ package1 }} again in check mode
|
|
|
|
|
yum: name={{ package1 }} state=removed
|
|
|
|
|
check_mode: true
|
|
|
|
|
register: yum_result
|
|
|
|
|
|
|
|
|
@ -25,8 +30,8 @@
|
|
|
|
|
that:
|
|
|
|
|
- "not yum_result is changed"
|
|
|
|
|
|
|
|
|
|
- name: uninstall sos again
|
|
|
|
|
yum: name=sos state=removed
|
|
|
|
|
- name: uninstall {{ package1 }} again
|
|
|
|
|
yum: name={{ package1 }} state=removed
|
|
|
|
|
register: yum_result
|
|
|
|
|
|
|
|
|
|
- name: verify no change on re-uninstall
|
|
|
|
@ -35,21 +40,21 @@
|
|
|
|
|
- "not yum_result is changed"
|
|
|
|
|
|
|
|
|
|
# INSTALL
|
|
|
|
|
- name: install sos in check mode
|
|
|
|
|
yum: name=sos state=present
|
|
|
|
|
- name: install {{ package1 }} in check mode
|
|
|
|
|
yum: name={{ package1 }} state=present
|
|
|
|
|
check_mode: true
|
|
|
|
|
register: yum_result
|
|
|
|
|
|
|
|
|
|
- name: verify installation of sos in check mode
|
|
|
|
|
- name: verify installation of {{ package1 }} in check mode
|
|
|
|
|
assert:
|
|
|
|
|
that:
|
|
|
|
|
- "yum_result is changed"
|
|
|
|
|
|
|
|
|
|
- name: install sos
|
|
|
|
|
yum: name=sos state=present
|
|
|
|
|
- name: install {{ package1 }}
|
|
|
|
|
yum: name={{ package1 }} state=present
|
|
|
|
|
register: yum_result
|
|
|
|
|
|
|
|
|
|
- name: verify installation of sos
|
|
|
|
|
- name: verify installation of {{ package1 }}
|
|
|
|
|
assert:
|
|
|
|
|
that:
|
|
|
|
|
- "yum_result is success"
|
|
|
|
@ -62,12 +67,12 @@
|
|
|
|
|
- "'msg' in yum_result"
|
|
|
|
|
- "'results' in yum_result"
|
|
|
|
|
|
|
|
|
|
- name: check sos with rpm
|
|
|
|
|
shell: rpm -q sos
|
|
|
|
|
- name: check {{ package1 }} with rpm
|
|
|
|
|
shell: rpm -q {{ package1 }}
|
|
|
|
|
|
|
|
|
|
# INSTALL AGAIN
|
|
|
|
|
- name: install sos again in check mode
|
|
|
|
|
yum: name=sos state=present
|
|
|
|
|
- name: install {{ package1 }} again in check mode
|
|
|
|
|
yum: name={{ package1 }} state=present
|
|
|
|
|
check_mode: true
|
|
|
|
|
register: yum_result
|
|
|
|
|
- name: verify no change on second install in check mode
|
|
|
|
@ -75,16 +80,16 @@
|
|
|
|
|
that:
|
|
|
|
|
- "not yum_result is changed"
|
|
|
|
|
|
|
|
|
|
- name: install sos again
|
|
|
|
|
yum: name=sos state=present
|
|
|
|
|
- name: install {{ package1 }} again
|
|
|
|
|
yum: name={{ package1 }} state=present
|
|
|
|
|
register: yum_result
|
|
|
|
|
- name: verify no change on second install
|
|
|
|
|
assert:
|
|
|
|
|
that:
|
|
|
|
|
- "not yum_result is changed"
|
|
|
|
|
|
|
|
|
|
- name: install sos again with empty string enablerepo
|
|
|
|
|
yum: name=sos state=present enablerepo=""
|
|
|
|
|
- name: install {{ package1 }} again with empty string enablerepo
|
|
|
|
|
yum: name={{ package1 }} state=present enablerepo=""
|
|
|
|
|
register: yum_result
|
|
|
|
|
- name: verify no change on third install with empty string enablerepo
|
|
|
|
|
assert:
|
|
|
|
@ -94,14 +99,11 @@
|
|
|
|
|
|
|
|
|
|
# This test case is unfortunately distro specific because we have to specify
|
|
|
|
|
# repo names which are not the same across Fedora/RHEL/CentOS for base/updates
|
|
|
|
|
- name: install sos again with missing repo enablerepo
|
|
|
|
|
- name: install {{ package1 }} again with missing repo enablerepo
|
|
|
|
|
yum:
|
|
|
|
|
name: sos
|
|
|
|
|
name: '{{ package1 }}'
|
|
|
|
|
state: present
|
|
|
|
|
enablerepo:
|
|
|
|
|
- "thisrepodoesnotexist"
|
|
|
|
|
- "base"
|
|
|
|
|
- "updates"
|
|
|
|
|
enablerepo: '{{ repos + ["thisrepodoesnotexist"] }}'
|
|
|
|
|
disablerepo: "*"
|
|
|
|
|
register: yum_result
|
|
|
|
|
when: ansible_distribution == 'CentOS'
|
|
|
|
@ -114,13 +116,11 @@
|
|
|
|
|
|
|
|
|
|
# This test case is unfortunately distro specific because we have to specify
|
|
|
|
|
# repo names which are not the same across Fedora/RHEL/CentOS for base/updates
|
|
|
|
|
- name: install sos again with disable all and enable select repo(s)
|
|
|
|
|
- name: install repos again with disable all and enable select repo(s)
|
|
|
|
|
yum:
|
|
|
|
|
name: sos
|
|
|
|
|
name: '{{ package1 }}'
|
|
|
|
|
state: present
|
|
|
|
|
enablerepo:
|
|
|
|
|
- "base"
|
|
|
|
|
- "updates"
|
|
|
|
|
enablerepo: '{{ repos }}'
|
|
|
|
|
disablerepo: "*"
|
|
|
|
|
register: yum_result
|
|
|
|
|
when: ansible_distribution == 'CentOS'
|
|
|
|
@ -131,9 +131,9 @@
|
|
|
|
|
- "yum_result is not changed"
|
|
|
|
|
when: ansible_distribution == 'CentOS'
|
|
|
|
|
|
|
|
|
|
- name: install sos again with only missing repo enablerepo
|
|
|
|
|
- name: install {{ package1 }} again with only missing repo enablerepo
|
|
|
|
|
yum:
|
|
|
|
|
name: sos
|
|
|
|
|
name: '{{ package1 }}'
|
|
|
|
|
state: present
|
|
|
|
|
enablerepo: "thisrepodoesnotexist"
|
|
|
|
|
ignore_errors: true
|
|
|
|
@ -150,28 +150,28 @@
|
|
|
|
|
when: ansible_pkg_mgr == 'dnf'
|
|
|
|
|
|
|
|
|
|
# INSTALL AGAIN WITH LATEST
|
|
|
|
|
- name: install sos again with state latest in check mode
|
|
|
|
|
yum: name=sos state=latest
|
|
|
|
|
- name: install {{ package1 }} again with state latest in check mode
|
|
|
|
|
yum: name={{ package1 }} state=latest
|
|
|
|
|
check_mode: true
|
|
|
|
|
register: yum_result
|
|
|
|
|
- name: verify install sos again with state latest in check mode
|
|
|
|
|
- name: verify install {{ package1 }} again with state latest in check mode
|
|
|
|
|
assert:
|
|
|
|
|
that:
|
|
|
|
|
- "not yum_result is changed"
|
|
|
|
|
|
|
|
|
|
- name: install sos again with state latest idempotence
|
|
|
|
|
yum: name=sos state=latest
|
|
|
|
|
- name: install {{ package1 }} again with state latest idempotence
|
|
|
|
|
yum: name={{ package1 }} state=latest
|
|
|
|
|
register: yum_result
|
|
|
|
|
- name: verify install sos again with state latest idempotence
|
|
|
|
|
- name: verify install {{ package1 }} again with state latest idempotence
|
|
|
|
|
assert:
|
|
|
|
|
that:
|
|
|
|
|
- "not yum_result is changed"
|
|
|
|
|
|
|
|
|
|
# INSTALL WITH LATEST
|
|
|
|
|
- name: uninstall sos
|
|
|
|
|
yum: name=sos state=removed
|
|
|
|
|
- name: uninstall {{ package1 }}
|
|
|
|
|
yum: name={{ package1 }} state=removed
|
|
|
|
|
register: yum_result
|
|
|
|
|
- name: verify uninstall sos
|
|
|
|
|
- name: verify uninstall {{ package1 }}
|
|
|
|
|
assert:
|
|
|
|
|
that:
|
|
|
|
|
- "yum_result is successful"
|
|
|
|
@ -184,11 +184,11 @@
|
|
|
|
|
register: yum_conf_copy
|
|
|
|
|
|
|
|
|
|
- block:
|
|
|
|
|
- name: install sos with state latest in check mode with config file param
|
|
|
|
|
yum: name=sos state=latest conf_file=/etc/yum.conf
|
|
|
|
|
- name: install {{ package1 }} with state latest in check mode with config file param
|
|
|
|
|
yum: name={{ package1 }} state=latest conf_file=/etc/yum.conf
|
|
|
|
|
check_mode: true
|
|
|
|
|
register: yum_result
|
|
|
|
|
- name: verify install sos with state latest in check mode with config file param
|
|
|
|
|
- name: verify install {{ package1 }} with state latest in check mode with config file param
|
|
|
|
|
assert:
|
|
|
|
|
that:
|
|
|
|
|
- "yum_result is changed"
|
|
|
|
@ -200,62 +200,62 @@
|
|
|
|
|
state: absent
|
|
|
|
|
when: yum_conf_copy is changed
|
|
|
|
|
|
|
|
|
|
- name: install sos with state latest in check mode
|
|
|
|
|
yum: name=sos state=latest
|
|
|
|
|
- name: install {{ package1 }} with state latest in check mode
|
|
|
|
|
yum: name={{ package1 }} state=latest
|
|
|
|
|
check_mode: true
|
|
|
|
|
register: yum_result
|
|
|
|
|
- name: verify install sos with state latest in check mode
|
|
|
|
|
- name: verify install {{ package1 }} with state latest in check mode
|
|
|
|
|
assert:
|
|
|
|
|
that:
|
|
|
|
|
- "yum_result is changed"
|
|
|
|
|
|
|
|
|
|
- name: install sos with state latest
|
|
|
|
|
yum: name=sos state=latest
|
|
|
|
|
- name: install {{ package1 }} with state latest
|
|
|
|
|
yum: name={{ package1 }} state=latest
|
|
|
|
|
register: yum_result
|
|
|
|
|
- name: verify install sos with state latest
|
|
|
|
|
- name: verify install {{ package1 }} with state latest
|
|
|
|
|
assert:
|
|
|
|
|
that:
|
|
|
|
|
- "yum_result is changed"
|
|
|
|
|
|
|
|
|
|
- name: install sos with state latest idempotence
|
|
|
|
|
yum: name=sos state=latest
|
|
|
|
|
- name: install {{ package1 }} with state latest idempotence
|
|
|
|
|
yum: name={{ package1 }} state=latest
|
|
|
|
|
register: yum_result
|
|
|
|
|
- name: verify install sos with state latest idempotence
|
|
|
|
|
- name: verify install {{ package1 }} with state latest idempotence
|
|
|
|
|
assert:
|
|
|
|
|
that:
|
|
|
|
|
- "not yum_result is changed"
|
|
|
|
|
|
|
|
|
|
- name: install sos with state latest idempotence with config file param
|
|
|
|
|
yum: name=sos state=latest
|
|
|
|
|
- name: install {{ package1 }} with state latest idempotence with config file param
|
|
|
|
|
yum: name={{ package1 }} state=latest
|
|
|
|
|
register: yum_result
|
|
|
|
|
- name: verify install sos with state latest idempotence with config file param
|
|
|
|
|
- name: verify install {{ package1 }} with state latest idempotence with config file param
|
|
|
|
|
assert:
|
|
|
|
|
that:
|
|
|
|
|
- "not yum_result is changed"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Multiple packages
|
|
|
|
|
- name: uninstall sos and bc
|
|
|
|
|
yum: name=sos,bc state=removed
|
|
|
|
|
- name: uninstall {{ package1 }} and {{ package2 }}
|
|
|
|
|
yum: name={{ package1 }},{{ package2 }} state=removed
|
|
|
|
|
|
|
|
|
|
- name: check sos with rpm
|
|
|
|
|
shell: rpm -q sos
|
|
|
|
|
- name: check {{ package1 }} with rpm
|
|
|
|
|
shell: rpm -q {{ package1 }}
|
|
|
|
|
ignore_errors: True
|
|
|
|
|
register: rpm_sos_result
|
|
|
|
|
register: rpm_package1_result
|
|
|
|
|
|
|
|
|
|
- name: check bc with rpm
|
|
|
|
|
shell: rpm -q bc
|
|
|
|
|
- name: check {{ package2 }} with rpm
|
|
|
|
|
shell: rpm -q {{ package2 }}
|
|
|
|
|
ignore_errors: True
|
|
|
|
|
register: rpm_bc_result
|
|
|
|
|
register: rpm_package2_result
|
|
|
|
|
|
|
|
|
|
- name: verify packages installed
|
|
|
|
|
assert:
|
|
|
|
|
that:
|
|
|
|
|
- "rpm_sos_result is failed"
|
|
|
|
|
- "rpm_bc_result is failed"
|
|
|
|
|
- "rpm_package1_result is failed"
|
|
|
|
|
- "rpm_package2_result is failed"
|
|
|
|
|
|
|
|
|
|
- name: install sos and bc as comma separated
|
|
|
|
|
yum: name=sos,bc state=present
|
|
|
|
|
- name: install {{ package1 }} and {{ package2 }} as comma separated
|
|
|
|
|
yum: name={{ package1 }},{{ package2 }} state=present
|
|
|
|
|
register: yum_result
|
|
|
|
|
|
|
|
|
|
- name: verify packages installed
|
|
|
|
@ -264,21 +264,21 @@
|
|
|
|
|
- "yum_result is success"
|
|
|
|
|
- "yum_result is changed"
|
|
|
|
|
|
|
|
|
|
- name: check sos with rpm
|
|
|
|
|
shell: rpm -q sos
|
|
|
|
|
- name: check {{ package1 }} with rpm
|
|
|
|
|
shell: rpm -q {{ package1 }}
|
|
|
|
|
|
|
|
|
|
- name: check bc with rpm
|
|
|
|
|
shell: rpm -q bc
|
|
|
|
|
- name: check {{ package2 }} with rpm
|
|
|
|
|
shell: rpm -q {{ package2 }}
|
|
|
|
|
|
|
|
|
|
- name: uninstall sos and bc
|
|
|
|
|
yum: name=sos,bc state=removed
|
|
|
|
|
- name: uninstall {{ package1 }} and {{ package2 }}
|
|
|
|
|
yum: name={{ package1 }},{{ package2 }} state=removed
|
|
|
|
|
register: yum_result
|
|
|
|
|
|
|
|
|
|
- name: install sos and bc as list
|
|
|
|
|
- name: install {{ package1 }} and {{ package2 }} as list
|
|
|
|
|
yum:
|
|
|
|
|
name:
|
|
|
|
|
- sos
|
|
|
|
|
- bc
|
|
|
|
|
- '{{ package1 }}'
|
|
|
|
|
- '{{ package2 }}'
|
|
|
|
|
state: present
|
|
|
|
|
register: yum_result
|
|
|
|
|
|
|
|
|
@ -288,19 +288,19 @@
|
|
|
|
|
- "yum_result is success"
|
|
|
|
|
- "yum_result is changed"
|
|
|
|
|
|
|
|
|
|
- name: check sos with rpm
|
|
|
|
|
shell: rpm -q sos
|
|
|
|
|
- name: check {{ package1 }} with rpm
|
|
|
|
|
shell: rpm -q {{ package1 }}
|
|
|
|
|
|
|
|
|
|
- name: check bc with rpm
|
|
|
|
|
shell: rpm -q bc
|
|
|
|
|
- name: check {{ package2 }} with rpm
|
|
|
|
|
shell: rpm -q {{ package2 }}
|
|
|
|
|
|
|
|
|
|
- name: uninstall sos and bc
|
|
|
|
|
yum: name=sos,bc state=removed
|
|
|
|
|
- name: uninstall {{ package1 }} and {{ package2 }}
|
|
|
|
|
yum: name={{ package1 }},{{ package2 }} state=removed
|
|
|
|
|
register: yum_result
|
|
|
|
|
|
|
|
|
|
- name: install sos and bc as comma separated with spaces
|
|
|
|
|
- name: install {{ package1 }} and {{ package2 }} as comma separated with spaces
|
|
|
|
|
yum:
|
|
|
|
|
name: "sos, bc"
|
|
|
|
|
name: "{{ package1 }}, {{ package2 }}"
|
|
|
|
|
state: present
|
|
|
|
|
register: yum_result
|
|
|
|
|
|
|
|
|
@ -310,14 +310,14 @@
|
|
|
|
|
- "yum_result is success"
|
|
|
|
|
- "yum_result is changed"
|
|
|
|
|
|
|
|
|
|
- name: check sos with rpm
|
|
|
|
|
shell: rpm -q sos
|
|
|
|
|
- name: check {{ package1 }} with rpm
|
|
|
|
|
shell: rpm -q {{ package1 }}
|
|
|
|
|
|
|
|
|
|
- name: check bc with rpm
|
|
|
|
|
shell: rpm -q bc
|
|
|
|
|
- name: check {{ package2 }} with rpm
|
|
|
|
|
shell: rpm -q {{ package2 }}
|
|
|
|
|
|
|
|
|
|
- name: uninstall sos and bc
|
|
|
|
|
yum: name=sos,bc state=removed
|
|
|
|
|
- name: uninstall {{ package1 }} and {{ package2 }}
|
|
|
|
|
yum: name={{ package1 }},{{ package2 }} state=removed
|
|
|
|
|
|
|
|
|
|
- name: install non-existent rpm
|
|
|
|
|
yum:
|
|
|
|
@ -331,11 +331,11 @@
|
|
|
|
|
- non_existent_rpm is failed
|
|
|
|
|
|
|
|
|
|
# Install in installroot='/'
|
|
|
|
|
- name: install sos
|
|
|
|
|
yum: name=sos state=present installroot='/'
|
|
|
|
|
- name: install {{ package1 }}
|
|
|
|
|
yum: name={{ package1 }} state=present installroot='/'
|
|
|
|
|
register: yum_result
|
|
|
|
|
|
|
|
|
|
- name: verify installation of sos
|
|
|
|
|
- name: verify installation of {{ package1 }}
|
|
|
|
|
assert:
|
|
|
|
|
that:
|
|
|
|
|
- "yum_result is success"
|
|
|
|
@ -348,16 +348,18 @@
|
|
|
|
|
- "'msg' in yum_result"
|
|
|
|
|
- "'results' in yum_result"
|
|
|
|
|
|
|
|
|
|
- name: check sos with rpm
|
|
|
|
|
shell: rpm -q sos --root=/
|
|
|
|
|
- name: check {{ package1 }} with rpm
|
|
|
|
|
shell: rpm -q {{ package1 }} --root=/
|
|
|
|
|
|
|
|
|
|
- name: uninstall sos
|
|
|
|
|
- name: uninstall {{ package1 }}
|
|
|
|
|
yum:
|
|
|
|
|
name: sos
|
|
|
|
|
name: '{{ package1 }}'
|
|
|
|
|
installroot: '/'
|
|
|
|
|
state: removed
|
|
|
|
|
register: yum_result
|
|
|
|
|
|
|
|
|
|
# Seems like some yum versions won't download a package from local file repository, continue to use sos for this test.
|
|
|
|
|
# https://stackoverflow.com/questions/58295660/yum-downloadonly-ignores-packages-in-local-repo
|
|
|
|
|
- name: Test download_only
|
|
|
|
|
yum:
|
|
|
|
|
name: sos
|
|
|
|
@ -452,11 +454,11 @@
|
|
|
|
|
yum:
|
|
|
|
|
name:
|
|
|
|
|
- "@Custom Group"
|
|
|
|
|
- sos
|
|
|
|
|
- '{{ package2 }}'
|
|
|
|
|
state: present
|
|
|
|
|
register: yum_result
|
|
|
|
|
|
|
|
|
|
- name: verify sos is installed
|
|
|
|
|
- name: verify {{ package3 }} is installed
|
|
|
|
|
assert:
|
|
|
|
|
that:
|
|
|
|
|
- "yum_result is success"
|
|
|
|
@ -769,69 +771,69 @@
|
|
|
|
|
- "'lohit-*-fonts is not installed' in remove_lohit_fonts_2['results']"
|
|
|
|
|
|
|
|
|
|
- block:
|
|
|
|
|
- name: uninstall bc
|
|
|
|
|
yum: name=bc state=removed
|
|
|
|
|
- name: uninstall {{ package2 }}
|
|
|
|
|
yum: name={{ package2 }} state=removed
|
|
|
|
|
|
|
|
|
|
- name: check bc with rpm
|
|
|
|
|
shell: rpm -q bc
|
|
|
|
|
- name: check {{ package2 }} with rpm
|
|
|
|
|
shell: rpm -q {{ package2 }}
|
|
|
|
|
ignore_errors: True
|
|
|
|
|
register: rpm_bc_result
|
|
|
|
|
register: rpm_package2_result
|
|
|
|
|
|
|
|
|
|
- name: verify bc is uninstalled
|
|
|
|
|
- name: verify {{ package2 }} is uninstalled
|
|
|
|
|
assert:
|
|
|
|
|
that:
|
|
|
|
|
- "rpm_bc_result is failed"
|
|
|
|
|
- "rpm_package2_result is failed"
|
|
|
|
|
|
|
|
|
|
- name: exclude bc (yum backend)
|
|
|
|
|
- name: exclude {{ package2 }} (yum backend)
|
|
|
|
|
lineinfile:
|
|
|
|
|
dest: /etc/yum.conf
|
|
|
|
|
regexp: (^exclude=)(.)*
|
|
|
|
|
line: "exclude=bc*"
|
|
|
|
|
line: "exclude={{ package2 }}*"
|
|
|
|
|
state: present
|
|
|
|
|
when: ansible_pkg_mgr == 'yum'
|
|
|
|
|
|
|
|
|
|
- name: exclude bc (dnf backend)
|
|
|
|
|
- name: exclude {{ package2 }} (dnf backend)
|
|
|
|
|
lineinfile:
|
|
|
|
|
dest: /etc/dnf/dnf.conf
|
|
|
|
|
regexp: (^excludepkgs=)(.)*
|
|
|
|
|
line: "excludepkgs=bc*"
|
|
|
|
|
line: "excludepkgs={{ package2 }}*"
|
|
|
|
|
state: present
|
|
|
|
|
when: ansible_pkg_mgr == 'dnf'
|
|
|
|
|
|
|
|
|
|
# begin test case where disable_excludes is supported
|
|
|
|
|
- name: Try install bc without disable_excludes
|
|
|
|
|
yum: name=bc state=latest
|
|
|
|
|
register: yum_bc_result
|
|
|
|
|
- name: Try install {{ package2 }} without disable_excludes
|
|
|
|
|
yum: name={{ package2 }} state=latest
|
|
|
|
|
register: yum_package2_result
|
|
|
|
|
ignore_errors: True
|
|
|
|
|
|
|
|
|
|
- name: verify bc did not install because it is in exclude list
|
|
|
|
|
- name: verify {{ package2 }} did not install because it is in exclude list
|
|
|
|
|
assert:
|
|
|
|
|
that:
|
|
|
|
|
- "yum_bc_result is failed"
|
|
|
|
|
- "yum_package2_result is failed"
|
|
|
|
|
|
|
|
|
|
- name: install bc with disable_excludes
|
|
|
|
|
yum: name=bc state=latest disable_excludes=all
|
|
|
|
|
register: yum_bc_result_using_excludes
|
|
|
|
|
- name: install {{ package2 }} with disable_excludes
|
|
|
|
|
yum: name={{ package2 }} state=latest disable_excludes=all
|
|
|
|
|
register: yum_package2_result_using_excludes
|
|
|
|
|
|
|
|
|
|
- name: verify bc did install using disable_excludes=all
|
|
|
|
|
- name: verify {{ package2 }} did install using disable_excludes=all
|
|
|
|
|
assert:
|
|
|
|
|
that:
|
|
|
|
|
- "yum_bc_result_using_excludes is success"
|
|
|
|
|
- "yum_bc_result_using_excludes is changed"
|
|
|
|
|
- "yum_bc_result_using_excludes is not failed"
|
|
|
|
|
- "yum_package2_result_using_excludes is success"
|
|
|
|
|
- "yum_package2_result_using_excludes is changed"
|
|
|
|
|
- "yum_package2_result_using_excludes is not failed"
|
|
|
|
|
|
|
|
|
|
- name: remove exclude bc (cleanup yum.conf)
|
|
|
|
|
- name: remove exclude {{ package2 }} (cleanup yum.conf)
|
|
|
|
|
lineinfile:
|
|
|
|
|
dest: /etc/yum.conf
|
|
|
|
|
regexp: (^exclude=bc*)
|
|
|
|
|
regexp: (^exclude={{ package2 }}*)
|
|
|
|
|
line: "exclude="
|
|
|
|
|
state: present
|
|
|
|
|
when: ansible_pkg_mgr == 'yum'
|
|
|
|
|
|
|
|
|
|
- name: remove exclude bc (cleanup dnf.conf)
|
|
|
|
|
- name: remove exclude {{ package2 }} (cleanup dnf.conf)
|
|
|
|
|
lineinfile:
|
|
|
|
|
dest: /etc/dnf/dnf.conf
|
|
|
|
|
regexp: (^excludepkgs=bc*)
|
|
|
|
|
regexp: (^excludepkgs={{ package2 }}*)
|
|
|
|
|
line: "excludepkgs="
|
|
|
|
|
state: present
|
|
|
|
|
when: ansible_pkg_mgr == 'dnf'
|
|
|
|
|