mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-07-03 09:08:54 +00:00
YUM - handle enable of non-existent repo (#53286)
This commit is contained in:
parent
5ef2c5314e
commit
666dfdc551
3 changed files with 66 additions and 11 deletions
|
|
@ -92,6 +92,43 @@
|
|||
- "yum_result is success"
|
||||
- "not yum_result is changed"
|
||||
|
||||
# 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
|
||||
yum:
|
||||
name: sos
|
||||
state: present
|
||||
enablerepo:
|
||||
- "thisrepodoesnotexist"
|
||||
- "base"
|
||||
- "updates"
|
||||
disablerepo: "*"
|
||||
register: yum_result
|
||||
when: ansible_distribution == 'CentOS'
|
||||
- name: verify no change on fourth install with missing repo enablerepo (yum)
|
||||
assert:
|
||||
that:
|
||||
- "yum_result is success"
|
||||
- "yum_result is not changed"
|
||||
when: ansible_distribution == 'CentOS'
|
||||
|
||||
- name: install sos again with only missing repo enablerepo
|
||||
yum:
|
||||
name: sos
|
||||
state: present
|
||||
enablerepo: "thisrepodoesnotexist"
|
||||
ignore_errors: true
|
||||
register: yum_result
|
||||
- name: verify no change on fifth install with only missing repo enablerepo (yum)
|
||||
assert:
|
||||
that:
|
||||
- "yum_result is not success"
|
||||
when: ansible_pkg_mgr == 'yum'
|
||||
- name: verify no change on fifth install with only missing repo enablerepo (dnf)
|
||||
assert:
|
||||
that:
|
||||
- "yum_result is success"
|
||||
when: ansible_pkg_mgr == 'dnf'
|
||||
|
||||
# INSTALL AGAIN WITH LATEST
|
||||
- name: install sos again with state latest in check mode
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue