Skip to content

Commit cf828fd

Browse files
committed
pulp_container_content: Support state=read for container-push repos
This allows us to check whether a tag exists in a container-push repository.
1 parent 10b9b9e commit cf828fd

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

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 }}"

0 commit comments

Comments
 (0)