awx surveys and nested yaml variables don't appear to work as expected

66 views
Skip to first unread message

Brandon Jozsa

unread,
Dec 17, 2017, 12:17:55 PM12/17/17
to Ansible Project
Hey everyone. I have some questions about how AWX handles nested yaml values for things like surveys.

I have a nested yaml declaration in previous playbook for group_vars, and they look like this:

# OS API User Login Information:
auth:
  os_username: "username"

# OS Project Details:
project:
  os_project: "admin"
  os_region_name: "RegionOne"
  os_domain_name: "Default"

And so on. This is definitely valid syntax, and when the variables are used in the playbook, they're translated like the following:

- name: creating new instances and attaching to declared networks
  os_server:
       state: present
       auth:
         auth_url: "{{ auth.os_auth_url }}"
         username: "{{ auth.os_username }}"
         password: "{{ os_password }}"
         project_name: "{{ project.os_project }}"
       name: "{{ instance.os_hostname }}"
       image: "{{ instance.os_image_id }}"
       key_name: "{{ instance.os_key_name }}"
       timeout: 200
       flavor: "{{ instance.os_flavor_id }}"
       network: "{{ network.os_network_id }}"
       meta:
         hostname: "{{ meta.os_hostname }}"
         group: "{{ meta.os_group }}"

This works perfectly fine (as expected) when running manually. However, I'm starting to PoC AWX for our use, before deciding to purchase a Tower support contract. Unfortunately, when trying to use these same variables in surveys, I receive an error that states "Please remove the illegal character from the survey question variable name". This occurs because AWX is not interpreting the "." as a valid element.

Can someone tell me if there's a work around, or do I need to redraft my playbooks (I would really like to avoid this if possible).

Thanks for the help/guidance in advance!

Brandon (IRC: v1k0d3n)

Reply all
Reply to author
Forward
0 new messages