From c3045f6a2982be7fc22928a9b4bf65027cb049d8 Mon Sep 17 00:00:00 2001 From: sean-m-sullivan Date: Sat, 10 Oct 2020 13:02:58 -0500 Subject: [PATCH] update delete --- .../plugins/modules/tower_workflow_job_template_node.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/awx_collection/plugins/modules/tower_workflow_job_template_node.py b/awx_collection/plugins/modules/tower_workflow_job_template_node.py index 6b3b90a151..bee8a84a81 100644 --- a/awx_collection/plugins/modules/tower_workflow_job_template_node.py +++ b/awx_collection/plugins/modules/tower_workflow_job_template_node.py @@ -237,7 +237,7 @@ def main(): if state == 'absent': # If the state was absent we can let the module delete it if needed, the module will handle exiting from this - module.delete_if_needed(existing_item) + module.delete_if_needed(existing_item, on_continue=True,) unified_job_template = module.params.get('unified_job_template') if unified_job_template: @@ -311,6 +311,9 @@ def main(): # Due to not able to lookup workflow_approval_templates, find the existing item in another place if workflow_job_template_node['related'].get('unified_job_template') is not None: existing_item = module.get_endpoint(workflow_job_template_node['related']['unified_job_template'])['json'] + if state == 'absent': + # If the state was absent we can let the module delete it if needed, the module will handle exiting from this + module.delete_if_needed(existing_item) module.create_or_update_if_needed( existing_item, new_fields, endpoint='workflow_job_template_nodes/' + str(workflow_job_template_node_id) + '/create_approval_template/', item_type='workflow_job_template_approval_node', on_continue=approval_node,