Open ksharma-qc opened 9 months ago
thanks for outlining these details. I guess one workaround for now is to use a non-dictionary variable for those variables you want set by the survey form
@mabashian do you know if the expectation is the survey value to be injected into a dictionary? is this fixed in the new UI?
thanks for outlining these details. I guess one workaround for now is to use a non-dictionary variable for those variables you want set by the survey form
@mabashian do you know if the expectation is the survey value to be injected into a dictionary? is this fixed in the new UI?
New UI? I'm currently at the latest version of AWX.
The problem with workaround is that'll require me to modify the code for playbooks which haven't been written by me.
The expectation is for the values to be injected into the dictionary yes. inputs.a.b
should translate to:
inputs:
a:
b:
Furthermore, the dictionary should be merged into any existing ones if ANSIBLE_HASH_BEHAVIOUR
is set to merge
.
@ksharma-qc thanks, yes sounds like a bug that would need some UI work to address
Just discovered this issue and without even knowing it, I have this problem and didn't realize it was due the variable to set being a dict key. in my case module_database.name
I thought there was a bug in the UI for having require: true
, so un-checked it for the survey question and now the survey gives no errors and the job template runs as it should. I just can't make the question mandatory.
Also found this to be true. The default values appear in the survey summary and can be curl'd, but they don't pre-populate in the survey.
The workaround provided by @fosterseth isn't suitable for me either, as the playbook was written by someone else. I could go through the process of opening a PR and changing all their variables to strings... but with a lot of variables, that's kinda rough and the author may not like that.
I know there's a new UI coming soon, is this is being worked on? I took a peak at the tech preview, but the survey screen is unavailable at the moment, so it's hard to tell.
Thanks!
If you unclick required it should work in the meantime, I am able to set dictionary values
Please confirm the following
security@ansible.com
instead.)Bug Summary
Variable dictionaries are supported in the Template variables and can be passed just fine as follows:
However, if a survey is created with variable name
inputs.region_code
as follows:Then AWX complains that the field is blank despite specifying values:
Given that Ansible supports nested variable dictionaries, and such variables can be passed from commandline or in Template definitions, the Survey should also support it so that existing Playbooks can be used rather than requiring them to be refactored to work with Surveys.
AWX version
23.7.0
Select the relevant components
Installation method
kubernetes
Modifications
no
Ansible version
No response
Operating system
No response
Web browser
Firefox, Chrome, Safari, Edge
Steps to reproduce
Try to override a nested variable from a Survey
Expected results
Values provided in Survey should be accepted and passed to the Playbook
Actual results
UI complains that the field is empty/missing
Additional information
No response