Skip to content

Manage servers defined via multiple groups #96

Description

@andrenarchy

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions