Skip to content

Commit 3ec53ad

Browse files
authored
Merge pull request #68 from stackhpc/read-container-push
pulp_container_content: Support state=read for container-push repos
2 parents 10b9b9e + 1a8c134 commit 3ec53ad

File tree

5 files changed

+13
-4
lines changed

5 files changed

+13
-4
lines changed

.github/workflows/pull_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
pulp:
19-
- "3.16"
2019
- "3.21"
20+
- "3.45"
2121
steps:
2222
# Checks-out the repository under $GITHUB_WORKSPACE, so it's accessible to the job
2323
- uses: actions/checkout@v3
@@ -27,7 +27,7 @@ jobs:
2727
- name: Install dependencies
2828
run: |
2929
python -m pip install --upgrade pip
30-
pip install ansible==5.* jmespath
30+
pip install ansible==5.* jmespath pulp-glue==0.21.*
3131
ansible-galaxy collection install git+file://$(pwd)
3232
3333
- name: Run Pulp in one

galaxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ namespace: stackhpc
22
name: pulp
33
description: >
44
Roles and plugins Pulp repository server configuration
5-
version: "0.5.4"
5+
version: "0.5.5"
66
readme: "README.md"
77
authors:
88
- "Piotr Parczewski"

plugins/modules/pulp_container_content.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
- Whether to allow missing tags when state is present.
2121
type: bool
2222
default: false
23+
is_push:
24+
description:
25+
- Whether repository is a container-push repository.
26+
type: bool
27+
default: false
2328
src_repo:
2429
description:
2530
- Name of the repository to copy content from when state is present.
@@ -181,6 +186,8 @@ def read(self):
181186
self.get_content_units(self)
182187

183188
def process(self):
189+
if self.module.params["state"] == "read" and self.module.params["is_push"]:
190+
self._list_id = "repositories_container_container_push_list"
184191
# Populate self.entity.
185192
self.find(failsafe=False)
186193
if self.module.params["state"] == "present":
@@ -198,6 +205,7 @@ def main():
198205
with PulpEntityAnsibleModule(
199206
argument_spec=dict(
200207
allow_missing={"type": "bool", "default": False},
208+
is_push={"type": "bool", "default": False},
201209
repository={"required": True},
202210
src_repo={},
203211
src_is_push={"type": "bool", "default": False},

roles/pulp_container_content/tasks/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
password: "{{ pulp_password }}"
77
validate_certs: "{{ pulp_validate_certs | bool }}"
88
allow_missing: "{{ item.allow_missing | default(omit) }}"
9+
is_push: "{{ item.is_push | default(omit) }}"
910
src_repo: "{{ item.src_repo | default(omit) }}"
1011
src_is_push: "{{ item.src_is_push | default(omit) }}"
1112
repository: "{{ item.repository }}"

tests/pulp-in-one.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set -o pipefail
88

99
mkdir -p settings
1010

11-
PULP_TAG=${PULP_TAG:-"3.21"}
11+
PULP_TAG=${PULP_TAG:-"3.45"}
1212

1313
cat << EOF > settings/settings.py
1414
CONTENT_ORIGIN='http://$(hostname):8080'

0 commit comments

Comments
 (0)