Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to set default pull policy for ee #15824

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from
Open
Changes from all commits
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
11 changes: 7 additions & 4 deletions awx_collection/plugins/modules/execution_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
pull:
description:
- determine image pull behavior
choices: ["always", "missing", "never"]
choices: ["", "always", "missing", "never"]
default: 'missing'
type: str
extends_documentation_fragment: awx.awx.auth
Expand Down Expand Up @@ -84,7 +84,7 @@ def main():
credential=dict(),
state=dict(choices=['present', 'absent', 'exists'], default='present'),
# NOTE: Default for pull differs from API (which is blank by default)
pull=dict(choices=['always', 'missing', 'never'], default='missing'),
pull=dict(choices=['always', 'missing', 'never', ''], default='missing'),
)

# Create a module for ourselves
Expand All @@ -110,8 +110,11 @@ def main():
if description:
new_fields['description'] = description

if pull:
new_fields['pull'] = pull
if pull is not None:
if pull == '':
new_fields['pull'] = None
else:
new_fields['pull'] = pull

# Attempt to look up the related items the user specified (these will fail the module if not found)
organization = module.params.get('organization')
Expand Down