I’m using AWX Survey with multiple variables. But i need to improve my AWX Survey to be able to populate survey choices that depend on prior survey choices.
For example if my first survey variable is called: region1, the second survey choice should be: A, B or C.
But if my first survey choice is other - region2, the second survey choice should be: D, E or F.
As i know AWX Survey still don’t have a thing called Dynamic/programmatical choices. But maybe there’re a way to somehow input a static structured format, for example, dict of lists, like: dict1 = {'region1': [A, B, C], 'region2':[D, E, F]} ?
I originally couldn’t see the need for programmable/dynamic surveys since dynamic inventories would be able to provide what I thought was needed, but after looking through that webpage, I really like the idea behind it.
Hello everybody.
I’m new to awx.
Was it planned in the awx project, the addition of the following features?
Add in the survey questionnaire, a feature to transmit a bash environment variable type $1 if the workflow must be applied to an inventory before a playbook. This would allow injecting a variable into an inventory script instead of an extra_vars variable. like this:
Since the dynamic survey option is not directly available in AWX, has anyone used some frontend form or web UI to populate the survey with the needed answers?
Recently did a RH AAP workshop where they made a Cisco IOS backup config with one playbook and restore it with another playbook. But the interesting thing is that when running the restore playbook, it showed the latest backup available.
I got the source and what they did is create a job using AWX/AAP API. There they dynamically updated the job template to add survey answers based on a set of backup files.
Of course you’ll have to run a playbook before to update your survey answers. But I think this may be a way.
Hi @wayt and @FaxMac
Your solution is a workaround, not a real answer to question.
Update survey or extra vars with jobtemplate or api call is something tha is not “dynamic” way to do.
Check for example ansibleforms, this is really dynamic, due to the fact the form propose is dynamic based on answer of the user or based on api call/db query on third part software .