redhat-cop/infra-ansible

Tower inventory variables are not working as expected

ostefek99 opened this issue · 1 comments

Latest changes in Tower inventory variables #536 are not working as expected.

How to replicate:

  1. create new inventory
...
  inventories:
  - name: "Test"
    description: ""
    organization: "Testing inventory"
    variables: |-
      ---
    hosts:
    - name: "localhost"
      description: ""
      variables: |-
        ---
        ansible_connection: local
        test_var: hello
...
  1. run the automation
  2. check your host variables

Result:
Host localhost has these variable:

{'test_var': 'hello', 'ansible_connection': 'local'}

Expected:

---
ansible_connection: local
test_var: hello

It looks like a glitch in AWX itself.

Checking the "variables" section the format seems wrong for yaml but it's correct when changing from yaml to json and back.

  1. "original" yaml
{'test_var': 'hello', 'ansible_connection': 'local'}
  1. json
{
 "test_var": "hello",
 "ansible_connection": "local"
}
  1. back to yaml
test_var: hello
ansible_connection: local

Closing this issue as it's not an issue with the infra-ansible.