-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Open
Description
Please confirm the following
- I agree to follow this project's code of conduct.
- I have checked the current issues for duplicates.
- I understand that AWX is open source software provided for free and that I might not receive a timely response.
- I am NOT reporting a (potential) security vulnerability. (These should be emailed to
[email protected]instead.)
Bug Summary
When an optional Survey question of type Text is left blank, AWX uses the value null in the job template extra vars. This is problematic because playbooks often rely on the extra vars and if/how they are defined. Storing null changes conditional behavior and can break workflows that expect empty or missing values for optional text inputs.
AWX version
24.6.1
Select the relevant components
- UI
- UI (tech preview)
- API
- Docs
- Collection
- CLI
- Other
Installation method
kubernetes
Modifications
no
Ansible version
2.19.4
Operating system
No response
Web browser
No response
Steps to reproduce
- Create or edit a Job Template, for e.g. following code:
---
- name: Print survey_variable
hosts: localhost
gather_facts: false
tasks:
- name: Print survey_variable
ansible.builtin.debug:
msg: "{{ survey_variable }}"
- name: Check if survey_variable is defined
ansible.builtin.debug:
msg: "survey_variable is defined"
when: survey_variable is defined - Add an optional Survey with a Text question
- Launch the Job Template.
- In the survey modal, leave the text field empty and proceed to start the job.
- Check the result
Expected results
An empty string, as it should be according to the documentation. This would also be the same behavior as when the variable is specified directly as a variable (without a Survey) in AWX or executed locally.
Actual results
The variable is present with value null of type string
Additional information
No response
Reactions are currently unavailable