Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions plugins/modules/python_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
description:
- Description of the repository
type: str
autopublish:
description:
- Publish new versions automatically.
required: false
type: bool
default: false
extends_documentation_fragment:
- pulp.squeezer.pulp.entity_state
- pulp.squeezer.pulp
Expand Down Expand Up @@ -89,13 +95,16 @@ def main():
argument_spec={
"name": {},
"description": {},
"autopublish": {"type": "bool", "default": False},
Comment thread
stephan2012 marked this conversation as resolved.
Outdated
},
required_if=[("state", "present", ["name"]), ("state", "absent", ["name"])],
) as module:
natural_key = {"name": module.params["name"]}
desired_attributes = {}
if module.params["description"] is not None:
desired_attributes["description"] = module.params["description"]
desired_attributes = {
k: module.params[k]
for k in ("description", "autopublish")
if module.params.get(k) is not None
}

module.process(natural_key, desired_attributes)

Expand Down