Is splitting of the inventory possible?

Hi,

assume we would have 1000 projects in a big company and an OPS guys
tells us to copy every detail for provisioning for qa, dev and prod in one
repository. Some told arguments:

  • just to clone one repository
  • all Unix machines require a basic setup and therefore the concrete inventory file has to have all hosts and roles
    (the intention is to maintain the host names at multiple locations)
    a) Is this the way to go or is there a better solution?

b) when a) could you please provide examples (url’s) where to read?

Kind Regards,
Thomas

Try setting up one inventory for QA, another for DEV, and a third for
production.
You can use the same playbooks with different inventories so it'll keep the
environments isolated but you'll get better consistency between each env.

We have that but it does not answer my question. We still would have one inventory file with all hosts for 1000 projects per qa, dev and prod, right?
(we have less than 1000 … is just a forced example)

Is it possible to organize … that OPS can “walk” all hosts also the repository has - if possible - splittet all details per team (or per component) - for
better readability without being forced to run the playbook several times?

If you have 250 hosts with the same roles applied to them,
then yes I'd go with that.

You can make the inventories less huge depending on your naming convention
by using regexes , e.g.

[webservers]
www[01:250].example.com

Or if you'd rather you can have multiple static inventory files in a single
inventory folder, that works too. Ansible loads them all to get the
list of hosts,
so that might fit better with what you're trying to do.