Open r1k0 opened 4 years ago
meanwhile, we found a workaround.
We use the extravar box prompt in the template. We set it as:
---
# DOCUMENTATION: https://<link to doc for that variable>
BIGIP_VIP_input:
# Paste the data structure hereunder
When run, user gets prompted and can paste the data structure.
Still, it'd be good if one could use a list of dict as input for textarea survey without parsing it to yaml on the playbook side.
+1 (for YAML and JSON format)
ISSUE TYPE
SUMMARY
We are an international company using Tower for network automation (RH contract). We are in the process of pushing all our plays to templates in tower, we want to extensively use the survey feature to let users input data for specific variables. So far so good.
More precisely, we want to use survey to have list of dictionnaries as input variable for specific playbooks. However, the only type of survey that can allow that, the textarea, is not processed as YAML. This forces our developers to pretask all those manual playbooks with:
The reason to do so, if I understand correctly, is because the variable is set as:
The hyphen here creates the trouble, as we only need:
If I use the GUI extra var in the template and set it as "user_input_var: |" the data is processed as YAML and all is fine, a data structure such as the one below works:
=> we would like to suggest the addition of another type of survey: textarea (YAML)
Where we can input a multiple line YAML variables (a list of dict) the same we do via group_vars or host_vars. Basically, it is the same as the existing textarea except that it's processed by "| from_yaml" so that we can keep the consistency between how ansible works in CLI and via tower (if somehow tower is not reachable when we need it - disaster recovery or else - we want to make sure CLI and GUI works with the same data structure).