I'm struggling to find a way to realize server configurations that are defined in the group vars of multiple groups but where the inventory maps these groups to the same host.
Details
I have 2 groups (frontend-servers, backend-servers) to which the debops.nginx role is applied via the following playbook:
---
- hosts: frontend-servers
roles:
- debops.nginx
- hosts: backend-servers
roles:
- debops.nginx
Furthermore, I define group variables for both groups:
---
# group_vars/frontend-servers.yaml
nginx_servers:
- '{{ frontend_server }}'
frontend_server:
enabled: True
#...
---
# group_vars/backend-servers.yaml
nginx_servers:
- '{{ backend_server }}'
backend_server:
enabled: True
#...
However, I have an inventory that maps both groups to the same host
[frontend-servers]
webserver
[backend-servers]
webserver
It seems like only one of the nginx_servers lists from the group_vars is respected. Is there another way to realize servers from multiple groups on the same host?
I'm struggling to find a way to realize server configurations that are defined in the group vars of multiple groups but where the inventory maps these groups to the same host.
Details
I have 2 groups (
frontend-servers,backend-servers) to which thedebops.nginxrole is applied via the following playbook:Furthermore, I define group variables for both groups:
However, I have an inventory that maps both groups to the same host
It seems like only one of the
nginx_serverslists from thegroup_varsis respected. Is there another way to realize servers from multiple groups on the same host?