In Ansible, in a role, I have vars files like this:
vars/
app1.yml
app2.yml
Each file contains vars specific to an app/website like
Wanted to post a possible alternate solution by getting a list of variables that match a pattern, then you can just process all those variables, sorta manual merge.
The following code block gives an example of pulling all variables that match a specific pattern and looping. you could set a new fact with them merged, or simply process them all individually.
- name: "debug2" debug:
msg: "value is: {{ lookup('vars', item) }} "
loop: "{{ hostvars[inventory_hostname] | select('match', '^linux_hosts_entries') |list }}"
see the following post for further details.