tower_workflow_template: Add missing options (#56891)

The following options can be set on a workflow template but the
functionallity to do so from this module was missing.

inventory
ask_variables_on_launch
ask_inventory_on_launch

Fixes #49728

Signed-off-by: Alberto Murillo <albertomurillosilva@gmail.com>
pull/58134/head
Alberto Murillo 5 years ago committed by ansibot
parent 9dbc838d99
commit 320d05dc30

@ -27,12 +27,26 @@ options:
description: description:
- If enabled, simultaneous runs of this job template will be allowed. - If enabled, simultaneous runs of this job template will be allowed.
type: bool type: bool
ask_extra_vars:
description:
- Prompt user for (extra_vars) on launch.
type: bool
version_added: "2.9"
ask_inventory:
description:
- Propmt user for inventory on launch.
type: bool
version_added: "2.9"
description: description:
description: description:
- The description to use for the workflow. - The description to use for the workflow.
extra_vars: extra_vars:
description: description:
- Extra variables used by Ansible in YAML or key=value format. - Extra variables used by Ansible in YAML or key=value format.
inventory:
description:
- Name of the inventory to use for the job template.
version_added: "2.9"
name: name:
description: description:
- The name to use for the workflow. - The name to use for the workflow.
@ -104,6 +118,9 @@ def main():
schema=dict(required=False), schema=dict(required=False),
survey=dict(required=False), survey=dict(required=False),
survey_enabled=dict(type='bool', required=False), survey_enabled=dict(type='bool', required=False),
inventory=dict(required=False),
ask_inventory=dict(type='bool', required=False),
ask_extra_vars=dict(type='bool', required=False),
state=dict(choices=['present', 'absent'], default='present'), state=dict(choices=['present', 'absent'], default='present'),
) )
@ -153,8 +170,14 @@ def main():
if module.params.get('survey'): if module.params.get('survey'):
params['survey_spec'] = module.params.get('survey') params['survey_spec'] = module.params.get('survey')
for key in ('allow_simultaneous', 'extra_vars', 'survey_enabled', if module.params.get('ask_extra_vars'):
'description'): params['ask_variables_on_launch'] = module.params.get('ask_extra_vars')
if module.params.get('ask_inventory'):
params['ask_inventory_on_launch'] = module.params.get('ask_inventory')
for key in ('allow_simultaneous', 'extra_vars', 'inventory',
'survey_enabled', 'description'):
if module.params.get(key): if module.params.get(key):
params[key] = module.params.get(key) params[key] = module.params.get(key)

Loading…
Cancel
Save