mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 09:27:36 -02:30
fix bug processing survey spec
This commit is contained in:
@@ -215,13 +215,15 @@ def main():
|
||||
new_fields['extra_vars'] = json.dumps(new_fields['extra_vars'])
|
||||
|
||||
on_change = None
|
||||
existing_spec = None
|
||||
if existing_item:
|
||||
existing_spec = module.get_endpoint('spec_endpoint')
|
||||
new_spec = module.params.get('survey')
|
||||
if new_spec and (new_spec != existing_spec):
|
||||
module.json_output['changed'] = True
|
||||
on_change = update_survey
|
||||
if new_spec:
|
||||
existing_spec = None
|
||||
if existing_item:
|
||||
spec_endpoint = existing_item.get('related', {}).get('survey_spec')
|
||||
existing_spec = module.get_endpoint(spec_endpoint)
|
||||
if new_spec != existing_spec:
|
||||
module.json_output['changed'] = True
|
||||
on_change = update_survey
|
||||
|
||||
if state == 'absent':
|
||||
# If the state was absent we can let the module delete it if needed, the module will handle exiting from this
|
||||
|
||||
@@ -165,6 +165,15 @@ EXAMPLES = '''
|
||||
organization: Default # organization of workflow job template
|
||||
extra_data:
|
||||
foo_key: bar_value
|
||||
|
||||
- name: Create parent node for prior node
|
||||
tower_workflow_job_template_node:
|
||||
identifier: my-root-node
|
||||
workflow: example-workflow
|
||||
unified_job_template: jt-for-node-use
|
||||
organization: Default
|
||||
success_nodes:
|
||||
- my-first-node
|
||||
'''
|
||||
|
||||
from ..module_utils.tower_api import TowerModule
|
||||
|
||||
Reference in New Issue
Block a user