From 8babb3e3e9b16b573e59260d40dce8b13379772c Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Fri, 12 Jun 2026 07:39:37 +0200 Subject: [PATCH] [PR #12222/53bde7f0 backport][stable-12] Add OpenSuSE Tumbleweed target to CI (#12224) Add OpenSuSE Tumbleweed target to CI (#12222) * Add OpenSuSE Tumbleweed target to CI. * Adjust tests. (cherry picked from commit 53bde7f011aad1063af4fae399add9a2f5ac0810) Co-authored-by: Felix Fontein --- .azure-pipelines/azure-pipelines.yml | 2 + .../cloud_init_data_facts/tasks/main.yml | 2 +- .../targets/ejabberd_user/tasks/main.yml | 3 +- .../targets/filesystem/tasks/main.yml | 2 + .../targets/filesystem/tasks/setup.yml | 3 +- tests/integration/targets/gem/vars/Suse.yml | 7 ++ .../targets/htpasswd/tasks/main.yml | 1 + .../lookup_passwordstore/tasks/main.yml | 2 +- .../lookup_passwordstore/tasks/package.yml | 7 +- .../lookup_passwordstore/vars/Suse.yml | 8 ++ .../integration/targets/monit/tasks/main.yml | 4 +- .../targets/setup_apache2/tasks/main.yml | 4 +- .../setup_redis_replication/defaults/main.yml | 4 + .../setup_redis_replication/tasks/main.yml | 2 +- .../targets/zypper/tasks/zypper.yml | 14 ++- .../files/systemsmanagement_Uyuni_Utils.repo | 6 +- .../tasks/zypper_repository.yml | 100 ++++++++++-------- 17 files changed, 112 insertions(+), 59 deletions(-) create mode 100644 tests/integration/targets/gem/vars/Suse.yml create mode 100644 tests/integration/targets/lookup_passwordstore/vars/Suse.yml diff --git a/.azure-pipelines/azure-pipelines.yml b/.azure-pipelines/azure-pipelines.yml index 93a224a67d..d3fb6288c9 100644 --- a/.azure-pipelines/azure-pipelines.yml +++ b/.azure-pipelines/azure-pipelines.yml @@ -348,6 +348,8 @@ stages: test: debian-bookworm/3.11 - name: Debian 13 Trixie test: debian-13-trixie/3.13 + - name: OpenSuSE Tumbleweed + test: opensuse-tumbleweed/3.13 - name: ArchLinux test: archlinux/3.14 groups: diff --git a/tests/integration/targets/cloud_init_data_facts/tasks/main.yml b/tests/integration/targets/cloud_init_data_facts/tasks/main.yml index 2f6bf74aea..c6ca54d645 100644 --- a/tests/integration/targets/cloud_init_data_facts/tasks/main.yml +++ b/tests/integration/targets/cloud_init_data_facts/tasks/main.yml @@ -24,7 +24,7 @@ # https://bugs.launchpad.net/ubuntu/+source/ureadahead/+bug/997838 when: - not (ansible_facts.distribution == "Ubuntu" and ansible_facts.distribution_major_version|int == 14) - - not (ansible_facts.os_family == "Suse" and ansible_facts.distribution_major_version|int == 15) + - not (ansible_facts.os_family == "Suse") - not (ansible_facts.distribution == 'Archlinux') # TODO: package seems to be broken, cannot be downloaded from mirrors? - not (ansible_facts.distribution == 'Alpine') # TODO: not sure what's wrong here, the module doesn't return what the tests expect - not (ansible_facts.distribution == 'Debian' and ansible_facts.distribution_major_version|int == 13) # TODO: not sure what's wrong here, the module doesn't return what the tests expect diff --git a/tests/integration/targets/ejabberd_user/tasks/main.yml b/tests/integration/targets/ejabberd_user/tasks/main.yml index 5e77e55514..e4aec4f043 100644 --- a/tests/integration/targets/ejabberd_user/tasks/main.yml +++ b/tests/integration/targets/ejabberd_user/tasks/main.yml @@ -14,7 +14,8 @@ # TODO: remove Ubuntu 24.04 or newer from the list # TODO: remove Debian 13 (Trixie) from the list when: > - ansible_facts.distribution in ('Alpine', 'openSUSE Leap', 'CentOS', 'Fedora', 'Archlinux') + ansible_facts.distribution in ('Alpine', 'openSUSE Leap', 'openSUSE Tumbleweed', 'CentOS', 'Fedora', 'Archlinux', 'Suse') + or ansible_facts.os_family == 'Suse' or (ansible_facts.distribution == 'Ubuntu' and ansible_facts.distribution_major_version | int >= 24) or (ansible_facts.distribution == 'Debian' and ansible_facts.distribution_major_version == '13') diff --git a/tests/integration/targets/filesystem/tasks/main.yml b/tests/integration/targets/filesystem/tasks/main.yml index 68aa02da33..82de4e2f1b 100644 --- a/tests/integration/targets/filesystem/tasks/main.yml +++ b/tests/integration/targets/filesystem/tasks/main.yml @@ -60,6 +60,8 @@ - 'not (ansible_facts.distribution == "Alpine" and item.0.key == "reiserfs")' # reiserfsprogs packages no longer available with Arch Linux - 'not (ansible_facts.distribution == "Archlinux" and item.0.key == "reiserfs")' + # reiserfsprogs packages no longer available with OpenSuSE + - 'not (ansible_facts.os_family == "Suse" and item.0.key == "reiserfs")' # reiserfsprogs packages no longer available with Ubuntu 26.04 - 'not (item.0.key == "reiserfs" and ansible_facts.distribution == "Ubuntu" and (ansible_facts.distribution_major_version | int >= 26))' # ocfs2 only available on Debian based distributions diff --git a/tests/integration/targets/filesystem/tasks/setup.yml b/tests/integration/targets/filesystem/tasks/setup.yml index edf1609ee8..5a52f620b9 100644 --- a/tests/integration/targets/filesystem/tasks/setup.yml +++ b/tests/integration/targets/filesystem/tasks/setup.yml @@ -58,10 +58,9 @@ when: - ansible_facts.distribution == 'Fedora' and (ansible_facts.distribution_major_version | int < 35) -- name: "Install reiserfs and util-linux-systemd (for findmnt) (OpenSuse)" +- name: "Install util-linux-systemd (for findmnt) (OpenSuse)" ansible.builtin.package: name: - - reiserfs - util-linux-systemd state: present when: diff --git a/tests/integration/targets/gem/vars/Suse.yml b/tests/integration/targets/gem/vars/Suse.yml new file mode 100644 index 0000000000..2bb724bfe3 --- /dev/null +++ b/tests/integration/targets/gem/vars/Suse.yml @@ -0,0 +1,7 @@ +--- +# Copyright (c) Ansible Project +# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +# SPDX-License-Identifier: GPL-3.0-or-later + +test_packages: + - "rubygems" diff --git a/tests/integration/targets/htpasswd/tasks/main.yml b/tests/integration/targets/htpasswd/tasks/main.yml index 17fa34ffba..7251e3385c 100644 --- a/tests/integration/targets/htpasswd/tasks/main.yml +++ b/tests/integration/targets/htpasswd/tasks/main.yml @@ -7,6 +7,7 @@ # passlib is dead and doesn't work with recent bcrypt versions anymore # (https://foss.heptapod.net/python-libs/passlib/-/work_items/196) - ansible_facts.distribution != 'Ubuntu' or ansible_facts.distribution_version is version('26.04', '<') + - ansible_facts.os_family != 'Suse' block: - name: install passlib ansible.builtin.pip: diff --git a/tests/integration/targets/lookup_passwordstore/tasks/main.yml b/tests/integration/targets/lookup_passwordstore/tasks/main.yml index c0b5eb5bdb..b7cd1e015e 100644 --- a/tests/integration/targets/lookup_passwordstore/tasks/main.yml +++ b/tests/integration/targets/lookup_passwordstore/tasks/main.yml @@ -14,4 +14,4 @@ when: # The pass package is no longer available in EPEL, so only test on Fedora, OpenSUSE, FreeBSD, macOS, and Ubuntu # https://lists.zx2c4.com/pipermail/password-store/2019-July/003689.html - - ansible_facts.distribution in ['FreeBSD', 'MacOSX', 'openSUSE Leap', 'Ubuntu'] + - ansible_facts.distribution in ['FreeBSD', 'MacOSX', 'openSUSE Leap', 'openSUSE Tumbleweed', 'Ubuntu'] diff --git a/tests/integration/targets/lookup_passwordstore/tasks/package.yml b/tests/integration/targets/lookup_passwordstore/tasks/package.yml index 5fcc9b77f6..ed8379b39a 100644 --- a/tests/integration/targets/lookup_passwordstore/tasks/package.yml +++ b/tests/integration/targets/lookup_passwordstore/tasks/package.yml @@ -15,11 +15,10 @@ - "{{ role_path }}/vars" - name: Install package - action: "{{ ansible_facts.pkg_mgr }}" - args: + ansible.builtin.package: name: "{{ passwordstore_packages }}" state: present - when: ansible_facts.pkg_mgr in ['apt', 'dnf', 'yum', 'pkgng', 'community.general.pkgng'] + when: ansible_facts.pkg_mgr in ['apt', 'dnf', 'yum', 'pkgng', 'community.general.pkgng'] or ansible_facts.distribution == 'openSUSE Tumbleweed' - block: # OpenSUSE Leap>=15.0 don't include password-store in main repo @@ -34,7 +33,7 @@ state: present update_cache: true disable_gpg_check: true - when: ansible_facts.pkg_mgr in ['zypper', 'community.general.zypper'] + when: ansible_facts.distribution == 'openSUSE Leap' # See https://github.com/gopasspw/gopass/issues/1849#issuecomment-802789285 - name: Install gopass on Debian diff --git a/tests/integration/targets/lookup_passwordstore/vars/Suse.yml b/tests/integration/targets/lookup_passwordstore/vars/Suse.yml new file mode 100644 index 0000000000..368a4670dd --- /dev/null +++ b/tests/integration/targets/lookup_passwordstore/vars/Suse.yml @@ -0,0 +1,8 @@ +--- +# Copyright (c) Ansible Project +# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +# SPDX-License-Identifier: GPL-3.0-or-later + +passwordstore_packages: + - gopass + - password-store diff --git a/tests/integration/targets/monit/tasks/main.yml b/tests/integration/targets/monit/tasks/main.yml index 3778a94826..94391e6d71 100644 --- a/tests/integration/targets/monit/tasks/main.yml +++ b/tests/integration/targets/monit/tasks/main.yml @@ -8,7 +8,9 @@ # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later -- block: +- when: + - ansible_facts.os_family != 'Suse' + block: - name: Install EPEL repository (only effective in RHEL) include_role: name: setup_epel diff --git a/tests/integration/targets/setup_apache2/tasks/main.yml b/tests/integration/targets/setup_apache2/tasks/main.yml index d531ea6980..ea22d31f61 100644 --- a/tests/integration/targets/setup_apache2/tasks/main.yml +++ b/tests/integration/targets/setup_apache2/tasks/main.yml @@ -19,7 +19,9 @@ - name: Install apache via zypper community.general.zypper: - name: apache2 + name: + - apache2 + - apache2-utils state: present when: "ansible_facts.os_family == 'Suse'" diff --git a/tests/integration/targets/setup_redis_replication/defaults/main.yml b/tests/integration/targets/setup_redis_replication/defaults/main.yml index 2501854185..6a6e4e9f0d 100644 --- a/tests/integration/targets/setup_redis_replication/defaults/main.yml +++ b/tests/integration/targets/setup_redis_replication/defaults/main.yml @@ -15,6 +15,8 @@ redis_packages: - redis-server openSUSE Leap: - redis + openSUSE Tumbleweed: + - redis Fedora: - redis CentOS: @@ -28,6 +30,7 @@ redis_user: Debian: redis Ubuntu: redis openSUSE Leap: redis + openSUSE Tumbleweed: redis Fedora: "{{ '998' if ansible_facts.distribution_major_version is version('41', '>=') else 'redis' }}" CentOS: redis FreeBSD: redis @@ -38,6 +41,7 @@ redis_bin: Debian: /usr/bin/redis-server Ubuntu: /usr/bin/redis-server openSUSE Leap: /usr/sbin/redis-server + openSUSE Tumbleweed: /usr/sbin/redis-server Fedora: "/usr/bin/{{ 'valkey-server' if ansible_facts.distribution_major_version is version('41', '>=') else 'redis-server' }}" CentOS: /usr/bin/redis-server FreeBSD: /usr/local/bin/redis-server diff --git a/tests/integration/targets/setup_redis_replication/tasks/main.yml b/tests/integration/targets/setup_redis_replication/tasks/main.yml index c6074d7f32..20a06718a5 100644 --- a/tests/integration/targets/setup_redis_replication/tasks/main.yml +++ b/tests/integration/targets/setup_redis_replication/tasks/main.yml @@ -9,4 +9,4 @@ - import_tasks: setup_redis_cluster.yml when: - - ansible_facts.distribution in ['CentOS', 'Fedora', 'FreeBSD', 'openSUSE Leap', 'Ubuntu', 'Debian', 'Archlinux', 'Alpine'] + - ansible_facts.distribution in ['CentOS', 'Fedora', 'FreeBSD', 'openSUSE Leap', 'openSUSE Tumbleweed', 'Ubuntu', 'Debian', 'Archlinux', 'Alpine'] diff --git a/tests/integration/targets/zypper/tasks/zypper.yml b/tests/integration/targets/zypper/tasks/zypper.yml index e71de15a03..a2e15c6da3 100644 --- a/tests/integration/targets/zypper/tasks/zypper.yml +++ b/tests/integration/targets/zypper/tasks/zypper.yml @@ -6,10 +6,22 @@ - name: get hello package version shell: zypper --xmlout se -svx hello | grep 'name="hello"' | grep 'repository="Main Repository"' | sed 's/.*edition="\([^ ]*\)".*/\1/' register: hello_version + when: ansible_facts.distribution == 'openSUSE Leap' -- name: set URL of test package +- name: set URL of test package (Leap) set_fact: hello_package_url: https://download.opensuse.org/distribution/leap/{{ ansible_facts.distribution_version }}/repo/oss/x86_64/hello-{{ hello_version.stdout }}.x86_64.rpm + when: ansible_facts.distribution == 'openSUSE Leap' + +- name: get hello package version + shell: zypper --xmlout se -svx hello | grep 'name="hello"' | grep 'repository="openSUSE-Tumbleweed-Oss"' | sed 's/.*edition="\([^ ]*\)".*/\1/' + register: hello_version_tumbleweed + when: ansible_facts.distribution == 'openSUSE Tumbleweed' + +- name: set URL of test package (Tumbleweed) + set_fact: + hello_package_url: https://download.opensuse.org/tumbleweed/repo/oss/x86_64/hello-{{ hello_version_tumbleweed.stdout }}.x86_64.rpm + when: ansible_facts.distribution == 'openSUSE Tumbleweed' - debug: var=hello_package_url diff --git a/tests/integration/targets/zypper_repository/files/systemsmanagement_Uyuni_Utils.repo b/tests/integration/targets/zypper_repository/files/systemsmanagement_Uyuni_Utils.repo index aaa486d929..fafbf491a3 100644 --- a/tests/integration/targets/zypper_repository/files/systemsmanagement_Uyuni_Utils.repo +++ b/tests/integration/targets/zypper_repository/files/systemsmanagement_Uyuni_Utils.repo @@ -3,9 +3,9 @@ # SPDX-License-Identifier: GPL-3.0-or-later [systemsmanagement_Uyuni_Utils] -name=Several utilities to develop, build or release Uyuni (openSUSE_Leap_15.3) +name=Several utilities to develop, build or release Uyuni ({{ ansible_facts.distribution.replace(' ', '_') }}_15.3) type=rpm-md -baseurl=https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Utils/openSUSE_Leap_15.3/ +baseurl=https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Utils/{{ ansible_facts.distribution.replace(' ', '_') }}_15.3/ gpgcheck=1 -gpgkey=https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Utils/openSUSE_Leap_15.3/repodata/repomd.xml.key +gpgkey=https://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Utils/{{ ansible_facts.distribution.replace(' ', '_') }}_15.3/repodata/repomd.xml.key enabled=1 diff --git a/tests/integration/targets/zypper_repository/tasks/zypper_repository.yml b/tests/integration/targets/zypper_repository/tasks/zypper_repository.yml index 7518497fc3..cf88d7c147 100644 --- a/tests/integration/targets/zypper_repository/tasks/zypper_repository.yml +++ b/tests/integration/targets/zypper_repository/tasks/zypper_repository.yml @@ -3,6 +3,18 @@ # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later +- set_fact: + os_repository_name_videolan: Leap_{{ ansible_facts.distribution_version }} + os_repository_name: "openSUSE_Leap_{{ ansible_facts.distribution_version }}" + os_release_ver: "{{ ansible_facts.distribution.replace(' ', '_') }}" + when: ansible_facts.distribution == 'openSUSE Leap' + +- set_fact: + os_repository_name_videolan: Tumbleweed + os_repository_name: openSUSE_Tumbleweed + os_release_ver: "{{ ansible_facts.distribution.replace(' ', '_') }}" + when: ansible_facts.distribution == 'openSUSE Tumbleweed' + - name: Delete test repo community.general.zypper_repository: name: test @@ -42,7 +54,7 @@ community.general.zypper_repository: name: test state: present - repo: http://download.videolan.org/pub/vlc/SuSE/Leap_{{ ansible_facts.distribution_version }}/ + repo: http://download.videolan.org/pub/vlc/SuSE/{{ os_repository_name_videolan }}/ register: zypper_result - name: Verify change on URL only change @@ -55,7 +67,7 @@ name: testrefresh refresh: false state: present - repo: http://download.videolan.org/pub/vlc/SuSE/Leap_{{ ansible_facts.distribution_version }}/ + repo: http://download.videolan.org/pub/vlc/SuSE/{{ os_repository_name_videolan }}/ - name: check refreshoption command: zypper -x lr testrefresh @@ -71,7 +83,7 @@ name: testprio priority: 55 state: present - repo: http://download.videolan.org/pub/vlc/SuSE/Leap_{{ ansible_facts.distribution_version }}/ + repo: http://download.videolan.org/pub/vlc/SuSE/{{ os_repository_name_videolan }}/ - name: check refreshoption command: zypper -x lr testprio @@ -114,8 +126,8 @@ state: present repo: "{{ item }}" with_items: - - http://download.opensuse.org/repositories/science/openSUSE_Leap_{{ ansible_facts.distribution_version }}/ - - http://download.opensuse.org/repositories/devel:/languages:/ruby/openSUSE_Leap_{{ ansible_facts.distribution_version }}/ + - http://download.opensuse.org/repositories/science/{{ os_repository_name }}/ + - http://download.opensuse.org/repositories/devel:/languages:/ruby/{{ os_repository_name }}/ - name: check repo is updated by name command: zypper lr samename @@ -129,7 +141,7 @@ - name: remove last added repos (by URL to test that) community.general.zypper_repository: - repo: http://download.opensuse.org/repositories/devel:/languages:/ruby/openSUSE_Leap_{{ ansible_facts.distribution_version }}/ + repo: http://download.opensuse.org/repositories/devel:/languages:/ruby/{{ os_repository_name }}/ state: absent # FIXME: this currently fails with `Repository 'Apache_PHP_Modules' is invalid.` @@ -141,46 +153,48 @@ # auto_import_keys: true # state: "present" -- name: add a repo by releasever - community.general.zypper_repository: - name: releaseverrepo - repo: http://download.opensuse.org/repositories/devel:/languages:/ruby/openSUSE_Leap_$releasever/ - state: present - register: add_repo +- when: ansible_facts.distribution == 'openSUSE Leap' + block: + - name: add a repo by releasever + community.general.zypper_repository: + name: releaseverrepo + repo: http://download.opensuse.org/repositories/devel:/languages:/ruby/openSUSE_Leap_$releasever/ + state: present + register: add_repo -- name: add a repo by releasever again - community.general.zypper_repository: - name: releaseverrepo - repo: http://download.opensuse.org/repositories/devel:/languages:/ruby/openSUSE_Leap_$releasever/ - state: present - register: add_repo_again + - name: add a repo by releasever again + community.general.zypper_repository: + name: releaseverrepo + repo: http://download.opensuse.org/repositories/devel:/languages:/ruby/openSUSE_Leap_$releasever/ + state: present + register: add_repo_again -- name: no update in case of $releasever usage in url - assert: - that: - - add_repo is changed - - add_repo_again is not changed + - name: no update in case of $releasever usage in url + assert: + that: + - add_repo is changed + - add_repo_again is not changed -- name: remove added repo - community.general.zypper_repository: - repo: http://download.opensuse.org/repositories/devel:/languages:/ruby/openSUSE_Leap_{{ ansible_facts.distribution_version }}/ - state: absent - register: remove_repo + - name: remove added repo + community.general.zypper_repository: + repo: http://download.opensuse.org/repositories/devel:/languages:/ruby/{{ os_repository_name }}/ + state: absent + register: remove_repo -- name: verify repo was removed - assert: - that: - - remove_repo is changed + - name: verify repo was removed + assert: + that: + - remove_repo is changed -- name: get list of files in /etc/zypp/repos.d/ - command: ls /etc/zypp/repos.d/ - changed_when: false - register: releaseverrepo_etc_zypp_reposd + - name: get list of files in /etc/zypp/repos.d/ + command: ls /etc/zypp/repos.d/ + changed_when: false + register: releaseverrepo_etc_zypp_reposd -- name: verify removal of file releaseverrepo.repo in /etc/zypp/repos.d/ - assert: - that: - - "'releaseverrepo' not in releaseverrepo_etc_zypp_reposd.stdout" + - name: verify removal of file releaseverrepo.repo in /etc/zypp/repos.d/ + assert: + that: + - "'releaseverrepo' not in releaseverrepo_etc_zypp_reposd.stdout" - name: add a repo by basearch community.general.zypper_repository: @@ -220,7 +234,7 @@ block: - name: add new repository via url to .repo file community.general.zypper_repository: - repo: http://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable/openSUSE_Leap_{{ ansible_facts.distribution_version }}/systemsmanagement:Uyuni:Stable.repo + repo: http://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable/{{ os_repository_name }}/systemsmanagement:Uyuni:Stable.repo state: present register: added_by_repo_file @@ -237,7 +251,7 @@ - name: add same repository via url to .repo file again to verify idempotency community.general.zypper_repository: - repo: http://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable/openSUSE_Leap_{{ ansible_facts.distribution_version }}/systemsmanagement:Uyuni:Stable.repo + repo: http://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable/{{ os_repository_name }}/systemsmanagement:Uyuni:Stable.repo state: present register: added_again_by_repo_file @@ -248,7 +262,7 @@ - name: remove repository via url to .repo file community.general.zypper_repository: - repo: http://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable/openSUSE_Leap_{{ ansible_facts.distribution_version }}/systemsmanagement:Uyuni:Stable.repo + repo: http://download.opensuse.org/repositories/systemsmanagement:/Uyuni:/Stable/{{ os_repository_name }}/systemsmanagement:Uyuni:Stable.repo state: absent register: removed_by_repo_file