diff options
author | Shane McDonald <me@shanemcd.com> | 2021-07-23 02:25:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-23 02:25:14 +0200 |
commit | 05c7d3a60ed78f5389f607feb05318014e91299e (patch) | |
tree | 8ed402206ce010676b04000f9e9833d4ec687384 /awx_collection | |
parent | Merge pull request #9944 from AlanCoding/schedule_teardown (diff) | |
parent | Fix to handle parameters with Boolean values correctly (diff) | |
download | awx-05c7d3a60ed78f5389f607feb05318014e91299e.tar.xz awx-05c7d3a60ed78f5389f607feb05318014e91299e.zip |
Merge pull request #10108 from saito-hideki/issue/10057
Fix to handle ask_* parameters correctly when set false
Diffstat (limited to 'awx_collection')
-rw-r--r-- | awx_collection/plugins/modules/workflow_job_template.py | 2 | ||||
-rw-r--r-- | awx_collection/tests/integration/targets/workflow_job_template/tasks/main.yml | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/awx_collection/plugins/modules/workflow_job_template.py b/awx_collection/plugins/modules/workflow_job_template.py index 16c8365bad..085903dac5 100644 --- a/awx_collection/plugins/modules/workflow_job_template.py +++ b/awx_collection/plugins/modules/workflow_job_template.py @@ -748,7 +748,7 @@ def main(): 'webhook_service', ): field_val = module.params.get(field_name) - if field_val: + if field_val is not None: new_fields[field_name] = field_val if 'extra_vars' in new_fields: diff --git a/awx_collection/tests/integration/targets/workflow_job_template/tasks/main.yml b/awx_collection/tests/integration/targets/workflow_job_template/tasks/main.yml index 527481281b..87fd84ab14 100644 --- a/awx_collection/tests/integration/targets/workflow_job_template/tasks/main.yml +++ b/awx_collection/tests/integration/targets/workflow_job_template/tasks/main.yml @@ -159,12 +159,30 @@ extra_vars: {'foo': 'bar', 'another-foo': {'barz': 'bar2'}} labels: - "{{ lab1 }}" + ask_inventory_on_launch: true + ask_scm_branch_on_launch: true + ask_limit_on_launch: true + ask_variables_on_launch: true register: result - assert: that: - "result is changed" +# Turn off ask_ * settings to test that the issue/10057 has been fixed +- name: Turn ask_* settings OFF + tower_workflow_job_template: + name: "{{ wfjt_name }}" + ask_inventory_on_launch: false + ask_scm_branch_on_launch: false + ask_limit_on_launch: false + ask_variables_on_launch: false + state: present + +- assert: + that: + - "result is changed" + # Node actions do what this schema command used to do # schema: [{"success": [{"job_template": "{{ jt1_name }}"}], "job_template": "{{ jt2_name }}"}] - name: Create leaf node |