Hi,
I’m responsible for dozens of separate projects or server environments (each containing multiple hosts) and now planning to manage all of them using ansible.
There’s a requirement to have a separate git repository for each environment configuration containing inventory, variables, vault, roles and playbooks belonging to that environment only.
The issue is that I need to have a combined inventory of all hosts from all environments so that I could for example run “ansible all …” command for every single host I manage.
I’m aware of the group feature of the inventory, but I can’t see how I could keep the configuration separated that way.
├── env1
│ │ ├── group_vars
│ │ │ └── …
│ │ │
│ │ ├── roles
│ │ │ └── …
│ │ │
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── hosts
│ │ └── site.yml
│ │
├── env2
│ │ ├── group_vars
│ │ │ └── …
│ │ │
│ │ ├── roles
│ │ │ └── …
│ │ │
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── hosts
│ │ └── site.yml
│ │
…
Is this kind of layout feasible? I couldn’t find any examples for a scenario like this and would appreciate any best practices for this kind of setup. Thank you.
Best Regards,
Lupu