mirror of
https://github.com/ansible/awx.git
synced 2026-05-24 00:57:48 -02:30
fix job launch inputs
This commit is contained in:
@@ -176,22 +176,34 @@ def main():
|
|||||||
optional_args = {}
|
optional_args = {}
|
||||||
# Extract our parameters
|
# Extract our parameters
|
||||||
name = module.params.get('name')
|
name = module.params.get('name')
|
||||||
optional_args['job_type'] = module.params.get('job_type')
|
|
||||||
inventory = module.params.get('inventory')
|
inventory = module.params.get('inventory')
|
||||||
organization = module.params.get('organization')
|
organization = module.params.get('organization')
|
||||||
credentials = module.params.get('credentials')
|
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')
|
wait = module.params.get('wait')
|
||||||
interval = module.params.get('interval')
|
interval = module.params.get('interval')
|
||||||
timeout = module.params.get('timeout')
|
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
|
# Create a datastructure to pass into our job launch
|
||||||
post_data = {}
|
post_data = {}
|
||||||
for key in optional_args.keys():
|
for key in optional_args.keys():
|
||||||
|
|||||||
@@ -48,6 +48,8 @@
|
|||||||
job_type: run
|
job_type: run
|
||||||
ask_credential: true
|
ask_credential: true
|
||||||
ask_inventory: true
|
ask_inventory: true
|
||||||
|
ask_tags_on_launch: true
|
||||||
|
ask_skip_tags_on_launch: true
|
||||||
state: present
|
state: present
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
@@ -56,6 +58,10 @@
|
|||||||
job_template: "{{ jt_name1 }}"
|
job_template: "{{ jt_name1 }}"
|
||||||
inventory: "Demo Inventory"
|
inventory: "Demo Inventory"
|
||||||
credential: "Demo Credential"
|
credential: "Demo Credential"
|
||||||
|
tags:
|
||||||
|
- sometimes
|
||||||
|
skip_tags:
|
||||||
|
- always
|
||||||
register: result
|
register: result
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
|||||||
Reference in New Issue
Block a user