We have a master workflow that invokes several other templates, and these templates have surveys to make it easier for non-ansible users to know what to pass in them.
In the master workflow when we select the given template, we’re asked to insert a value into that field, which is fine. If I attempt to add “{{ variable_name }}” / {{ variable_name }} (doesn’t matter with or without quotation) into that field, it doesn’t get templated in to the variable, and the variable value is exactly what we wrote in. I can see that when the template got invoked, that the variable looks like the other variables that got set in the “extra_variables” field in the template, and those work fine.
Is there a way we can work around this? Can we have a playbook that sets these variables before we invoke it? And let it be blank? Or will the value from the survey overwrite the “variable_setter_playbook”? Or is there some other smart way of sending a variables to templates that have surveys?
There is an email list for the AWX project specifically, and the question would be better asked there.
Templating from user-provided values is specifically disabled by the server, by marking those as unsafe with the Ansible YAML constructor. There is a setting available to control exactly what the scope of variables this is done for. If you are not concerned about the security implications of allowing lunch-time variables to be templated, then that setting should work for you.
Thank you very much for your reply. I will from now on keep my AWX-questions to that specific list.
I found another solution for this which was in the workflow, have a “setter_template” that sets variables for the rest of the templates with the module set_stats:
The module sends the variables as artifacts to all the other templates in the workflow and worked for the scenario that we had. You can set an arbitrary value in the mandatory survey and set_stats will overwrite that specific variable.