I think @Klaas is on the right track. Even though the dict you are defining is called variables, these aren’t “Ansible variables” in the sense that they participate in playbook lazy evaluation, can be referenced in/by other variables, etc.
But I don’t think you need to go to the extreme of using set_fact either. You might consider this:
Note: nothing in foo can reference anything else defined in foo or you’ll hit infinite recursion. But as long as everything in foo is some combination of literal and/or references to vars defined outside of foo you should be okay.
thanks, I’d looked that, but I don’t want the variables to be evaluated by the playbook, I want the resultant var in awx to be “{{ SomeOtherValue/{{ variable1 }}”
so when a job is run against any override at the time requires only variable1 to be included.
indeed, but the issue is that I want the entry in the inventory variables to be “{{ v1 }}/{{ v2 }}” in that instance, but not “SomeValue/SomeOtherValue”, but the playbook is evaluating “{{ v1 }}/{{ v2 }}” when what i want is to have the text “{{ v1 }}/{{ v2 }}”, so that they get evaluated when a job is run using that inventory.
if I edit the inventory in AWX manually I can enter that, and I have some terraform code that does push the entries in that way, but I want now to use ansible in order to populate the inventory instead.