From 108a72ee845f6b0ce56f232cfcf8164f10c49a0a Mon Sep 17 00:00:00 2001 From: Konstantin Kuminsky Date: Sun, 10 Mar 2024 18:22:31 -0400 Subject: [PATCH] Allow empty values for ee in template --- awx_collection/plugins/modules/job_template.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/awx_collection/plugins/modules/job_template.py b/awx_collection/plugins/modules/job_template.py index 81fe495120b6..d9d721512ca9 100644 --- a/awx_collection/plugins/modules/job_template.py +++ b/awx_collection/plugins/modules/job_template.py @@ -479,8 +479,11 @@ def main(): search_fields['organization'] = new_fields['organization'] = organization_id ee = module.params.get('execution_environment') - if ee: + if ee is not None: + if ee != '' and ee != 'None' and ee != '{}': new_fields['execution_environment'] = module.resolve_name_to_id('execution_environments', ee) + else: + new_fields['execution_environment'] = None # Attempt to look up an existing item based on the provided data existing_item = module.get_one('job_templates', name_or_id=name, check_exists=(state == 'exists'), **{'data': search_fields})