Hello,
I’ve been writing with ansible for a while now. However, I have an unanswered question.
I’m using a rather complex inventory structure that calls for several roles, some of whose values may be shared.
For example, several roles use
hosts.yml
all:
children:
groupe1:
hosts:
test[1:2]:
groupe2:
children:
g2_g1:
hosts:
test4:
g2_g2:
hosts:
test5:
group_vars/groupe1.yml
variable1_a: "group_1"
test_dict:
list1:
- item1:
- item2:
var1: ""
var2: "{{ variable1_a }}"
test1_dict:
var1: "{{ variable1_a }}" # value group_1
var2: "{{ variable1_a }}_chaine1" # Value group_1_chaine1
this syntax doesn’t work, but it’s to show you the idea of having dictionaries linked to flat variables
I hope my need is clear.
Thank you very much for your explanations and knowledge