Repository: ansible/awx

Issue:
tower_workflow_job_template not changing ask_limit_on_launch
<!-- Issues are for **concrete, actionable bugs and feature requests** only - if you're just asking for debugging help or technical support, please use:

- http://webchat.freenode.net/?channels=ansible-awx
- https://groups.google.com/forum/#!forum/awx-project

We have to limit this because of limited volunteer time to respond to issues! -->

##### ISSUE TYPE
 - Bug Report

##### SUMMARY
When using tower_workflow_job_template to change ask_limit_on_launch the module is reporting OK and does not do the change.

##### ENVIRONMENT
* AWX version: 15.0.1
* AWX install method: docker on linux
* Ansible version:  2.10
* Operating System: SLES
* Web Browser: Chrome

##### STEPS TO REPRODUCE

1. Create a workflow template and set ask_limit_on_launch to true
2. Use the tower_workflow_job_template module to change ask_limit_on_launch to false

##### EXPECTED RESULTS

- Module should report change
- Workflow template should have ask_limit_on_launch set to false

##### ACTUAL RESULTS

- Module reports OK
- Workflow template have ask_limit_on_launch set to true

##### ADDITIONAL INFORMATION

I am using the following task:
```yaml
- name: Create a workflow job template
  awx.awx.tower_workflow_job_template:
    name: "{{ item.name }}"
    description: "{{ item.description }}"
    organization: "{{ item.organization }}"
    survey_enabled: "{{ item.survey_enabled|default('no') }}"
    ask_limit_on_launch: "{{ item.ask_limit_on_launch|default('no') }}"
    notification_templates_success: "{{ item.notification_templates_success|default(omit) }}"
    notification_templates_error: "{{ item.notification_templates_error|default(omit) }}"
    tower_host: "{{ tower_host }}"
    tower_username: "{{ tower_username }}"
    tower_password: "{{ tower_password }}"
    validate_certs: "{{ validate_certs }}"
  loop: "{{ workflow_templates }}"
```

with the following input:
```yaml
workflow_templates:
  - name: "Update the inventory"
    description: "Update the inventory"
    organization: "myOrg"
    notification_templates_success:
      - "Mail"
    notification_templates_error:
      - "Mail"
```


Discussion:

Resolving patch:
diff --git a/awx_collection/plugins/modules/workflow_job_template.py b/awx_collection/plugins/modules/workflow_job_template.py
--- a/awx_collection/plugins/modules/workflow_job_template.py
+++ b/awx_collection/plugins/modules/workflow_job_template.py
@@ -751,7 +751,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:


Test patch:
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
--- 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