I was wondering how could I target specific template for the group. Let's say I have invetory with following groups:
[group_1]
server_1
server_2
server_3
[group_2]
server_4
server_5
server_6
[group_3]
server_7
server_8
server_9
And then template directory containing files as follows:
├── templates
│ ├── group1_config.yml.j2
│ ├── group2_config.yml.j2
│ └── group3_config.yml.j2
What would be convenient way to get config by the group for correct hosts?
One way I was thinking that could I target them by having variable in template file name like:
{{ group_names }}.config.yml.j2
probably not ok like that :)
Any ideas?
Thanks!