mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
* Disable repo URL test for OpenSuSE 15.4.
* Forgot some places.
(cherry picked from commit dd24c98fe5
)
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
f06a73f893
commit
33bd1dd4ca
1 changed files with 40 additions and 37 deletions
|
@ -207,50 +207,53 @@
|
||||||
that:
|
that:
|
||||||
- remove_repo is changed
|
- remove_repo is changed
|
||||||
|
|
||||||
- name: add new repository via url to .repo file
|
# For now, the URL does not work for 15.4
|
||||||
community.general.zypper_repository:
|
- when: ansible_distribution_version is version('15.4', '<')
|
||||||
repo: http://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable/openSUSE_Leap_{{ ansible_distribution_version }}/systemsmanagement:Uyuni:Stable.repo
|
block:
|
||||||
state: present
|
- name: add new repository via url to .repo file
|
||||||
register: added_by_repo_file
|
community.general.zypper_repository:
|
||||||
|
repo: http://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable/openSUSE_Leap_{{ ansible_distribution_version }}/systemsmanagement:Uyuni:Stable.repo
|
||||||
|
state: present
|
||||||
|
register: added_by_repo_file
|
||||||
|
|
||||||
- name: get repository details from zypper
|
- name: get repository details from zypper
|
||||||
command: zypper lr systemsmanagement_Uyuni_Stable
|
command: zypper lr systemsmanagement_Uyuni_Stable
|
||||||
register: get_repository_details_from_zypper
|
register: get_repository_details_from_zypper
|
||||||
|
|
||||||
- name: verify adding via .repo file was successful
|
- name: verify adding via .repo file was successful
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- "added_by_repo_file is changed"
|
- "added_by_repo_file is changed"
|
||||||
- "get_repository_details_from_zypper.rc == 0"
|
- "get_repository_details_from_zypper.rc == 0"
|
||||||
- "'/systemsmanagement:/Uyuni:/Stable/' in get_repository_details_from_zypper.stdout"
|
- "'/systemsmanagement:/Uyuni:/Stable/' in get_repository_details_from_zypper.stdout"
|
||||||
|
|
||||||
- name: add same repository via url to .repo file again to verify idempotency
|
- name: add same repository via url to .repo file again to verify idempotency
|
||||||
community.general.zypper_repository:
|
community.general.zypper_repository:
|
||||||
repo: http://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable/openSUSE_Leap_{{ ansible_distribution_version }}/systemsmanagement:Uyuni:Stable.repo
|
repo: http://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable/openSUSE_Leap_{{ ansible_distribution_version }}/systemsmanagement:Uyuni:Stable.repo
|
||||||
state: present
|
state: present
|
||||||
register: added_again_by_repo_file
|
register: added_again_by_repo_file
|
||||||
|
|
||||||
- name: verify nothing was changed adding a repo with the same .repo file
|
- name: verify nothing was changed adding a repo with the same .repo file
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- added_again_by_repo_file is not changed
|
- added_again_by_repo_file is not changed
|
||||||
|
|
||||||
- name: remove repository via url to .repo file
|
- name: remove repository via url to .repo file
|
||||||
community.general.zypper_repository:
|
community.general.zypper_repository:
|
||||||
repo: http://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable/openSUSE_Leap_{{ ansible_distribution_version }}/systemsmanagement:Uyuni:Stable.repo
|
repo: http://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable/openSUSE_Leap_{{ ansible_distribution_version }}/systemsmanagement:Uyuni:Stable.repo
|
||||||
state: absent
|
state: absent
|
||||||
register: removed_by_repo_file
|
register: removed_by_repo_file
|
||||||
|
|
||||||
- name: get list of files in /etc/zypp/repos.d/
|
- name: get list of files in /etc/zypp/repos.d/
|
||||||
command: ls /etc/zypp/repos.d/
|
command: ls /etc/zypp/repos.d/
|
||||||
changed_when: false
|
changed_when: false
|
||||||
register: etc_zypp_reposd
|
register: etc_zypp_reposd
|
||||||
|
|
||||||
- name: verify removal via .repo file was successful, including cleanup of local .repo file in /etc/zypp/repos.d/
|
- name: verify removal via .repo file was successful, including cleanup of local .repo file in /etc/zypp/repos.d/
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- "removed_by_repo_file"
|
- "removed_by_repo_file"
|
||||||
- "'/systemsmanagement:/Uyuni:/Stable/' not in etc_zypp_reposd.stdout"
|
- "'/systemsmanagement:/Uyuni:/Stable/' not in etc_zypp_reposd.stdout"
|
||||||
|
|
||||||
- name: Copy test .repo file
|
- name: Copy test .repo file
|
||||||
copy:
|
copy:
|
||||||
|
|
Loading…
Reference in a new issue