From 8a572e74f086c077eef2668d6deb8669772fb119 Mon Sep 17 00:00:00 2001 From: Alex Welsh Date: Wed, 1 Jul 2026 12:59:03 +0100 Subject: [PATCH 1/6] Bump dependencies Bumps Ansible pulp collections (pulp squeezer and our downstream ansible-collection-pulp) to the same versions we currently use in SKC. These should come with bugfixes and performance improvements. These now depend on pulp-glue and pulp-glue-deb pip packages, which have been added to requirements.txt --- .github/actions/setup/action.yml | 10 +++------- requirements.txt | 3 +++ requirements.yml | 6 ++---- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index c4720f9d..297fda6c 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -22,14 +22,10 @@ runs: # Install python dependencies for ansible server side - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: - python-version: 3.11.x + python-version: 3.12.x # Cache Python dependencies cache: pip - - - name: Install Python dependencies - run: | - pip install -r requirements.txt - shell: bash + pip-install: -r requirements.txt - name: Install Ansible collection dependencies run: | @@ -48,5 +44,5 @@ runs: # everywhere. It's fine for CI purposes. - name: Install Python dependencies run: | - /usr/bin/python3 -m pip install setuptools --break-system-packages + /usr/bin/python3 -m pip install setuptools pulp-glue==0.33.* pulp-glue-deb==0.3.* --break-system-packages shell: bash diff --git a/requirements.txt b/requirements.txt index b7a6f650..f939cd31 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,5 @@ ansible<14 jmespath==0.10.0 +pulp-glue==0.33.* +pulp-glue-deb==0.3.* +setuptools diff --git a/requirements.yml b/requirements.yml index eaa7177c..af26a2e9 100644 --- a/requirements.yml +++ b/requirements.yml @@ -1,8 +1,6 @@ --- collections: - name: stackhpc.pulp - version: 0.5.4 - - name: community.crypto - version: 2.0.2 + version: 0.6.0 - name: pulp.squeezer - version: 0.0.13 + version: 0.3.0 From 49a9da2e210f176bda8ffe9d2fd1967b48fabc25 Mon Sep 17 00:00:00 2001 From: Alex Welsh Date: Mon, 3 Aug 2026 13:12:05 +0100 Subject: [PATCH 2/6] bodge --- requirements.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/requirements.yml b/requirements.yml index af26a2e9..5297e1d5 100644 --- a/requirements.yml +++ b/requirements.yml @@ -1,6 +1,7 @@ --- collections: - - name: stackhpc.pulp - version: 0.6.0 + - name: https://github.com/stackhpc/ansible-collection-pulp.git + type: git + version: pub-for-dist - name: pulp.squeezer version: 0.3.0 From 6a23b4e9fd6bce65d16d7eb03a48e7e051ee8de0 Mon Sep 17 00:00:00 2001 From: Alex Welsh Date: Tue, 4 Aug 2026 09:01:11 +0100 Subject: [PATCH 3/6] try branch 2 --- requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index 5297e1d5..411c775f 100644 --- a/requirements.yml +++ b/requirements.yml @@ -2,6 +2,6 @@ collections: - name: https://github.com/stackhpc/ansible-collection-pulp.git type: git - version: pub-for-dist + version: pub-for-dist-2 - name: pulp.squeezer version: 0.3.0 From 282bafb99ccda33d73fdd9a63ebe4d781fd2662f Mon Sep 17 00:00:00 2001 From: Alex Welsh Date: Tue, 4 Aug 2026 10:20:03 +0100 Subject: [PATCH 4/6] Try creating dist if it doesn't exist --- ansible/test-pulp-repo-version-query.yml | 59 ++++++++++++++++++++---- 1 file changed, 51 insertions(+), 8 deletions(-) diff --git a/ansible/test-pulp-repo-version-query.yml b/ansible/test-pulp-repo-version-query.yml index 25a0e3d0..28ef0c7b 100644 --- a/ansible/test-pulp-repo-version-query.yml +++ b/ansible/test-pulp-repo-version-query.yml @@ -65,11 +65,32 @@ - vars: repo: "{{ pulp_deb_repos_list.repositories | selectattr('name', 'equalto', item.repository) | first }}" - pub: "{{ (pulp_deb_pubs_list.publications + pulp_deb_verbatim_pubs_list.publications) | selectattr('repository', 'equalto', repo.pulp_href) | stackhpc.pulp.sort_publications - | first }}" - dist: "{{ pulp_deb_dists_list.distributions | selectattr('publication', 'equalto', pub.pulp_href) | first }}" + pub: "{{ (pulp_deb_pubs_list.publications + pulp_deb_verbatim_pubs_list.publications) | selectattr('repository', 'equalto', repo.pulp_href) | stackhpc.pulp.sort_publications | first }}" + existing_dists: "{{ pulp_deb_dists_list.distributions | selectattr('name', 'equalto', item.name) | selectattr('publication', 'equalto', pub.pulp_href) | list }}" + dist: "{{ existing_dists[0] if (existing_dists | length > 0) else {} }}" block: + - name: Ensure Deb distributions exist for latest publication + pulp.squeezer.deb_distribution: + pulp_url: "{{ pulp_url }}" + username: "{{ pulp_username }}" + password: "{{ pulp_password }}" + name: "{{ item.name }}" + base_path: "{{ item.base_path }}" + publication: "{{ pub.pulp_href }}" + state: present + loop: "{{ dev_pulp_distribution_deb }}" + loop_control: + label: "{{ item.repository }}" + when: existing_dists | length == 0 + + - name: Re-query Deb distributions (to capture newly created ones) + pulp.squeezer.deb_distribution: + pulp_url: "{{ pulp_url }}" + username: "{{ pulp_username }}" + password: "{{ pulp_password }}" + register: pulp_deb_dists_list + - name: Display latest Deb distributions vars: info: @@ -84,8 +105,7 @@ - name: Set a fact about latest Deb versions ansible.builtin.set_fact: - test_pulp_repository_deb_repo_versions: "{{ test_pulp_repository_deb_repo_versions | default({}) | combine({item.short_name: dist.base_path | basename}) - }}" + test_pulp_repository_deb_repo_versions: "{{ test_pulp_repository_deb_repo_versions | default({}) | combine({item.short_name: dist.base_path | basename}) }}" loop: "{{ dev_pulp_distribution_deb }}" loop_control: label: "{{ item.repository }}" @@ -93,11 +113,35 @@ - name: Display latest versions fact ansible.builtin.debug: var: test_pulp_repository_deb_repo_versions + - vars: repo: "{{ pulp_rpm_repos_list.repositories | selectattr('name', 'equalto', item.repository) | first }}" pub: "{{ pulp_rpm_pubs_list.publications | selectattr('repository', 'equalto', repo.pulp_href) | stackhpc.pulp.sort_publications | first }}" - dist: "{{ pulp_rpm_dists_list.distributions | selectattr('publication', 'equalto', pub.pulp_href) | first }}" + existing_dists: "{{ pulp_rpm_dists_list.distributions | selectattr('name', 'equalto', item.name) | selectattr('publication', 'equalto', pub.pulp_href) | list }}" + dist: "{{ existing_dists[0] if (existing_dists | length > 0) else {} }}" + block: + - name: Ensure RPM distributions exist for latest publication + pulp.squeezer.rpm_distribution: + pulp_url: "{{ pulp_url }}" + username: "{{ pulp_username }}" + password: "{{ pulp_password }}" + name: "{{ item.name }}" + base_path: "{{ item.base_path }}" + publication: "{{ pub.pulp_href }}" + state: present + loop: "{{ dev_pulp_distribution_rpm }}" + loop_control: + label: "{{ item.repository }}" + when: existing_dists | length == 0 + + - name: Re-query RPM distributions (to capture newly created ones) + pulp.squeezer.rpm_distribution: + pulp_url: "{{ pulp_url }}" + username: "{{ pulp_username }}" + password: "{{ pulp_password }}" + register: pulp_rpm_dists_list + - name: Display latest RPM distributions vars: info: @@ -112,8 +156,7 @@ - name: Set a fact about latest RPM versions ansible.builtin.set_fact: - test_pulp_repository_rpm_repo_versions: "{{ test_pulp_repository_rpm_repo_versions | default({}) | combine({item.short_name: dist.base_path | basename}) - }}" + test_pulp_repository_rpm_repo_versions: "{{ test_pulp_repository_rpm_repo_versions | default({}) | combine({item.short_name: dist.base_path | basename}) }}" loop: "{{ dev_pulp_distribution_rpm }}" loop_control: label: "{{ item.repository }}" From 524a028c57f32f23aa4fce657e39316d44655b24 Mon Sep 17 00:00:00 2001 From: Alex Welsh Date: Tue, 4 Aug 2026 10:41:57 +0100 Subject: [PATCH 5/6] Formatting --- ansible/test-pulp-repo-version-query.yml | 33 +++++++++++++++++++----- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/ansible/test-pulp-repo-version-query.yml b/ansible/test-pulp-repo-version-query.yml index 28ef0c7b..530665a7 100644 --- a/ansible/test-pulp-repo-version-query.yml +++ b/ansible/test-pulp-repo-version-query.yml @@ -65,8 +65,14 @@ - vars: repo: "{{ pulp_deb_repos_list.repositories | selectattr('name', 'equalto', item.repository) | first }}" - pub: "{{ (pulp_deb_pubs_list.publications + pulp_deb_verbatim_pubs_list.publications) | selectattr('repository', 'equalto', repo.pulp_href) | stackhpc.pulp.sort_publications | first }}" - existing_dists: "{{ pulp_deb_dists_list.distributions | selectattr('name', 'equalto', item.name) | selectattr('publication', 'equalto', pub.pulp_href) | list }}" + pub: >- + {{ (pulp_deb_pubs_list.publications + pulp_deb_verbatim_pubs_list.publications) + | selectattr('repository', 'equalto', repo.pulp_href) + | stackhpc.pulp.sort_publications | first }} + existing_dists: >- + {{ pulp_deb_dists_list.distributions + | selectattr('publication', 'equalto', pub.pulp_href) + | list }} dist: "{{ existing_dists[0] if (existing_dists | length > 0) else {} }}" block: @@ -105,7 +111,10 @@ - name: Set a fact about latest Deb versions ansible.builtin.set_fact: - test_pulp_repository_deb_repo_versions: "{{ test_pulp_repository_deb_repo_versions | default({}) | combine({item.short_name: dist.base_path | basename}) }}" + test_pulp_repository_deb_repo_versions: >- + {{ test_pulp_repository_deb_repo_versions + | default({}) + | combine({item.short_name: dist.base_path | basename}) }} loop: "{{ dev_pulp_distribution_deb }}" loop_control: label: "{{ item.repository }}" @@ -116,10 +125,17 @@ - vars: repo: "{{ pulp_rpm_repos_list.repositories | selectattr('name', 'equalto', item.repository) | first }}" - pub: "{{ pulp_rpm_pubs_list.publications | selectattr('repository', 'equalto', repo.pulp_href) | stackhpc.pulp.sort_publications | first }}" - existing_dists: "{{ pulp_rpm_dists_list.distributions | selectattr('name', 'equalto', item.name) | selectattr('publication', 'equalto', pub.pulp_href) | list }}" + pub: >- + {{ pulp_rpm_pubs_list.publications + | selectattr('repository', 'equalto', repo.pulp_href) + | stackhpc.pulp.sort_publications | first }} + existing_dists: >- + {{ pulp_rpm_dists_list.distributions + | selectattr('name', 'match', item.short_name | replace('_', '-')) + | selectattr('publication', 'equalto', pub.pulp_href) + | list }} dist: "{{ existing_dists[0] if (existing_dists | length > 0) else {} }}" - + block: - name: Ensure RPM distributions exist for latest publication pulp.squeezer.rpm_distribution: @@ -156,7 +172,10 @@ - name: Set a fact about latest RPM versions ansible.builtin.set_fact: - test_pulp_repository_rpm_repo_versions: "{{ test_pulp_repository_rpm_repo_versions | default({}) | combine({item.short_name: dist.base_path | basename}) }}" + test_pulp_repository_rpm_repo_versions: >- + {{ test_pulp_repository_rpm_repo_versions + | default({}) + | combine({item.short_name: dist.base_path | basename}) }} loop: "{{ dev_pulp_distribution_rpm }}" loop_control: label: "{{ item.repository }}" From 419f04ce2ef9c15404daacc4fdd7e29f9aff3f9c Mon Sep 17 00:00:00 2001 From: Alex Welsh Date: Wed, 5 Aug 2026 12:01:31 +0100 Subject: [PATCH 6/6] fix various issues --- ansible/test-pulp-repo-version-query.yml | 51 +++++++++++++++++------- 1 file changed, 36 insertions(+), 15 deletions(-) diff --git a/ansible/test-pulp-repo-version-query.yml b/ansible/test-pulp-repo-version-query.yml index 530665a7..22c68d64 100644 --- a/ansible/test-pulp-repo-version-query.yml +++ b/ansible/test-pulp-repo-version-query.yml @@ -64,14 +64,22 @@ register: pulp_rpm_dists_list - vars: - repo: "{{ pulp_deb_repos_list.repositories | selectattr('name', 'equalto', item.repository) | first }}" - pub: >- + repo_list: >- + {{ pulp_deb_repos_list.repositories + | selectattr('name', 'equalto', item.repository) + | list }} + repo: "{{ repo_list[0] if (repo_list | length > 0) else {} }}" + pubs: >- {{ (pulp_deb_pubs_list.publications + pulp_deb_verbatim_pubs_list.publications) - | selectattr('repository', 'equalto', repo.pulp_href) - | stackhpc.pulp.sort_publications | first }} + | selectattr('repository', 'equalto', repo.get('pulp_href', '')) + | stackhpc.pulp.sort_publications | list }} + pub: "{{ pubs[0] if (pubs | length > 0) else {} }}" + base_name: "{{ item.name | regex_replace('-[0-9]{8}T[0-9]{6}$', '') }}" + safe_pattern: "^{{ base_name | regex_escape }}(-[0-9]{8}T[0-9]{6})?$" existing_dists: >- {{ pulp_deb_dists_list.distributions - | selectattr('publication', 'equalto', pub.pulp_href) + | selectattr('publication', 'equalto', pub.get('pulp_href', '')) + | selectattr('name', 'match', safe_pattern) | list }} dist: "{{ existing_dists[0] if (existing_dists | length > 0) else {} }}" @@ -83,12 +91,13 @@ password: "{{ pulp_password }}" name: "{{ item.name }}" base_path: "{{ item.base_path }}" - publication: "{{ pub.pulp_href }}" + publication: "{{ pub.get('pulp_href') }}" + content_guard: "{{ item.content_guard | default(omit) }}" state: present loop: "{{ dev_pulp_distribution_deb }}" loop_control: label: "{{ item.repository }}" - when: existing_dists | length == 0 + when: (pub | length > 0) and (existing_dists | length == 0) - name: Re-query Deb distributions (to capture newly created ones) pulp.squeezer.deb_distribution: @@ -108,6 +117,7 @@ loop: "{{ dev_pulp_distribution_deb }}" loop_control: label: "{{ item.repository }}" + when: pub | length > 0 - name: Set a fact about latest Deb versions ansible.builtin.set_fact: @@ -118,21 +128,29 @@ loop: "{{ dev_pulp_distribution_deb }}" loop_control: label: "{{ item.repository }}" + when: dist | length > 0 - name: Display latest versions fact ansible.builtin.debug: var: test_pulp_repository_deb_repo_versions - vars: - repo: "{{ pulp_rpm_repos_list.repositories | selectattr('name', 'equalto', item.repository) | first }}" - pub: >- + repo_list: >- + {{ pulp_rpm_repos_list.repositories + | selectattr('name', 'equalto', item.repository) + | list }} + repo: "{{ repo_list[0] if (repo_list | length > 0) else {} }}" + pubs: >- {{ pulp_rpm_pubs_list.publications - | selectattr('repository', 'equalto', repo.pulp_href) - | stackhpc.pulp.sort_publications | first }} + | selectattr('repository', 'equalto', repo.get('pulp_href', '')) + | stackhpc.pulp.sort_publications | list }} + pub: "{{ pubs[0] if (pubs | length > 0) else {} }}" + base_name: "{{ item.name | regex_replace('-[0-9]{8}T[0-9]{6}$', '') }}" + safe_pattern: "^{{ base_name | regex_escape }}(-[0-9]{8}T[0-9]{6})?$" existing_dists: >- {{ pulp_rpm_dists_list.distributions - | selectattr('name', 'match', item.short_name | replace('_', '-')) - | selectattr('publication', 'equalto', pub.pulp_href) + | selectattr('publication', 'equalto', pub.get('pulp_href', '')) + | selectattr('name', 'match', safe_pattern) | list }} dist: "{{ existing_dists[0] if (existing_dists | length > 0) else {} }}" @@ -144,12 +162,13 @@ password: "{{ pulp_password }}" name: "{{ item.name }}" base_path: "{{ item.base_path }}" - publication: "{{ pub.pulp_href }}" + publication: "{{ pub.get('pulp_href') }}" + content_guard: "{{ item.content_guard | default(omit) }}" state: present loop: "{{ dev_pulp_distribution_rpm }}" loop_control: label: "{{ item.repository }}" - when: existing_dists | length == 0 + when: (pub | length > 0) and (existing_dists | length == 0) - name: Re-query RPM distributions (to capture newly created ones) pulp.squeezer.rpm_distribution: @@ -169,6 +188,7 @@ loop: "{{ dev_pulp_distribution_rpm }}" loop_control: label: "{{ item.repository }}" + when: pub | length > 0 - name: Set a fact about latest RPM versions ansible.builtin.set_fact: @@ -179,6 +199,7 @@ loop: "{{ dev_pulp_distribution_rpm }}" loop_control: label: "{{ item.repository }}" + when: dist | length > 0 - name: Display latest versions fact ansible.builtin.debug: