Hi guys,
I'm testing out some variable logic here, would really appreciate some help.
I have the following content in one of my vars_files:
---
db:
- backend_oslo:
- name: db01
primary: server1
secondaries:
- server2
- server3
- backend_stockholm:
- name: db02
primary: server4
secondaries:
- server5
- server6
At a certain point in my playbook I have for instance "backend_oslo" in a fact (I'm picking up this thru group_names earlier in the play)
I'd like to be able to register the "contents" of the "backend_oslo" item in a dynamic fact so that I can access:
- name: db01
primary: server1
secondaries:
- server2
- server3
This is an exercise in trying to keep my intentory files as light as possible. I'm not 100% comfortable with the list logic of yaml and how to index into them dynamically. Is what I'm trying to do even possible using the built-in filters?