Skip to content

Commit

Permalink
update job launch
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-m-sullivan committed May 12, 2021
1 parent fc340dd commit a01cfbe
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions awx_collection/plugins/modules/tower_job_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,18 +180,31 @@ def main():
inventory = module.params.get('inventory')
organization = module.params.get('organization')
credentials = module.params.get('credentials')
optional_args['limit'] = module.params.get('limit')
optional_args['tags'] = module.params.get('tags')
optional_args['extra_vars'] = module.params.get('extra_vars')
optional_args['scm_branch'] = module.params.get('scm_branch')
optional_args['skip_tags'] = module.params.get('skip_tags')
optional_args['verbosity'] = module.params.get('verbosity')
optional_args['diff_mode'] = module.params.get('diff_mode')
optional_args['credential_passwords'] = module.params.get('credential_passwords')
wait = module.params.get('wait')
interval = module.params.get('interval')
timeout = module.params.get('timeout')

for field_name in (
'job_type',
'limit',
'extra_vars',
'scm_branch',
'verbosity',
'diff_mode',
'credential_passwords',
):
field_val = module.params.get(field_name)
if field_val is not None:
optional_args[field_name] = field_val

# Special treatment of tags parameters
job_tags = module.params.get('tags')
if job_tags is not None:
optional_args['job_tags'] = ",".join(job_tags)
skip_tags = module.params.get('skip_tags')
if skip_tags is not None:
optional_args['skip_tags'] = ",".join(skip_tags)

# Create a datastructure to pass into our job launch
post_data = {}
for key in optional_args.keys():
Expand Down

0 comments on commit a01cfbe

Please sign in to comment.