From cf828fd41272e74d5f7c3565b5f4cac6f0a63d54 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Fri, 9 Feb 2024 13:42:51 +0000 Subject: [PATCH 1/5] pulp_container_content: Support state=read for container-push repos This allows us to check whether a tag exists in a container-push repository. --- plugins/modules/pulp_container_content.py | 8 ++++++++ roles/pulp_container_content/tasks/main.yml | 1 + 2 files changed, 9 insertions(+) diff --git a/plugins/modules/pulp_container_content.py b/plugins/modules/pulp_container_content.py index c5aeef3..9bf1887 100644 --- a/plugins/modules/pulp_container_content.py +++ b/plugins/modules/pulp_container_content.py @@ -20,6 +20,11 @@ - Whether to allow missing tags when state is present. type: bool default: false + is_push: + description: + - Whether repository is a container-push repository. + type: bool + default: false src_repo: description: - Name of the repository to copy content from when state is present. @@ -181,6 +186,8 @@ def read(self): self.get_content_units(self) def process(self): + if self.module.params["state"] == "read" and self.module.params["is_push"]: + self._list_id = "repositories_container_container_push_list" # Populate self.entity. self.find(failsafe=False) if self.module.params["state"] == "present": @@ -198,6 +205,7 @@ def main(): with PulpEntityAnsibleModule( argument_spec=dict( allow_missing={"type": "bool", "default": False}, + is_push={"type": "bool", "default": False}, repository={"required": True}, src_repo={}, src_is_push={"type": "bool", "default": False}, diff --git a/roles/pulp_container_content/tasks/main.yml b/roles/pulp_container_content/tasks/main.yml index 46bd152..6f91868 100644 --- a/roles/pulp_container_content/tasks/main.yml +++ b/roles/pulp_container_content/tasks/main.yml @@ -6,6 +6,7 @@ password: "{{ pulp_password }}" validate_certs: "{{ pulp_validate_certs | bool }}" allow_missing: "{{ item.allow_missing | default(omit) }}" + is_push: "{{ item.is_push | default(omit) }}" src_repo: "{{ item.src_repo | default(omit) }}" src_is_push: "{{ item.src_is_push | default(omit) }}" repository: "{{ item.repository }}" From 744f686077f7d8dc2a345d924735d11643ec6ec2 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Fri, 9 Feb 2024 14:25:24 +0000 Subject: [PATCH 2/5] Add pulp-glue to integration test dependencies --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 1ccb8d9..1cfbfb6 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -27,7 +27,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install ansible==5.* jmespath + pip install ansible==5.* jmespath pulp-glue==0.21.* ansible-galaxy collection install git+file://$(pwd) - name: Run Pulp in one From 116ad6d1bc46edff3fb2b80aa68e18dda5b22b75 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Fri, 9 Feb 2024 14:23:44 +0000 Subject: [PATCH 3/5] Update version to 0.5.5 --- galaxy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/galaxy.yml b/galaxy.yml index 8e4ecc6..f69ae2a 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -2,7 +2,7 @@ namespace: stackhpc name: pulp description: > Roles and plugins Pulp repository server configuration -version: "0.5.4" +version: "0.5.5" readme: "README.md" authors: - "Piotr Parczewski" From 0c7da52e04b031963f947b0b18f5fa884cc642ba Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Fri, 9 Feb 2024 14:40:47 +0000 Subject: [PATCH 4/5] Update Pulp to 3.45 in integration tests One of the tests failed: Cannot open /var/lib/pulp/tmp/472@6a279c28a9a3/tmpx7xo368b/tmp0450y_ow-3a0f555ea0e559e403fd0273f0cc10d7ba533c1c8a86d17ab4aa9297c186da78-updateinfo.xml.zst: Cannot detect compression type) --- tests/pulp-in-one.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pulp-in-one.sh b/tests/pulp-in-one.sh index dba9807..be985c0 100755 --- a/tests/pulp-in-one.sh +++ b/tests/pulp-in-one.sh @@ -8,7 +8,7 @@ set -o pipefail mkdir -p settings -PULP_TAG=${PULP_TAG:-"3.21"} +PULP_TAG=${PULP_TAG:-"3.45"} cat << EOF > settings/settings.py CONTENT_ORIGIN='http://$(hostname):8080' From 1a8c1346005d92632a99cbea273ebbc0176f7cc5 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Fri, 9 Feb 2024 14:49:49 +0000 Subject: [PATCH 5/5] Test Pulp 3.21 and 3.45 in integration tests 3.16 fails in some RPM tests. --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 1cfbfb6..ac4afa4 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -16,8 +16,8 @@ jobs: fail-fast: false matrix: pulp: - - "3.16" - "3.21" + - "3.45" steps: # Checks-out the repository under $GITHUB_WORKSPACE, so it's accessible to the job - uses: actions/checkout@v3