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