We are building dynamic inventory scripts that pull both host/group info as well as variable data from our CMDB. We are in the initial phases so that data set is relatively small at the moment, but I’m worried about how well it’s going to scale to tens of thousands of hosts and even more variables.
I would like to be able to somehow pass parameters into the dynamic inventory script to indicate what pieces of the inventory are actually relevant to the playbook that I am running. Most times, I only care about a very small portion of the data and it doesn’t make sense to perform an expensive call to retrieve the entire set. Unfortunately I can’t find any viable options here except for setting environment variables before running the playbook, which to seems a bit janky.
Is anybody (reliably) using dynamic inventory with very large data sets? If so, any tips or tricks you can share?