Thanks for the response Michael. Mixing groups between dynamic and static works in Ansible 1.7 and higher, > so if you are not running that version, I'd upgrade. >
Yes, exactly. This is what I'm doing with my cloud inventories. The host inventory and basic group info comes via rax.py, and then a static file 'rollup_groups' that I described below is used as well. That's working great for me. > "To re-use this same method with static host inventories, the only way I > can see is to put each inventory file in a separate directory along with a > copy of rollup groups. " > > I don't understand this part of the question. > I'm looking for something similar with static inventories. What I was trying to explain was I though I could combine a static host list with my rollup groups file, but only if I put each static inventory in a separate directory with a copy of rollup groups. As far as I am aware, that's the only way to combine inventories. But I'm open to any other option...For example, if there was a way to combine inventories without having them in the same directory, or if there was a task-based solution to automatically populate parent groups. Thanks! > > On Wed, Aug 13, 2014 at 11:38 AM, Matthew Simon <[email protected] > <javascript:>> wrote: > >> Hello All! >> >> >> For many of my plays, I use groups of groups to handle items common to >> several systems. For example, given an inventory file such as: >> >> [jenkins_masters] >> host1 >> >> [jenkins_slaves] >> slave1 >> slave2 >> slave3 >> >> [jenkins_servers:children] >> jenkins_masters >> jenkins_slaves >> >> >> The playbook might look like: >> >> - hosts: jenkins_servers >> roles: >> - java >> >> >> - hosts: jenkins_masters >> roles: >> - jenkins >> >> - hosts: jenkins_slaves >> roles: >> - java_buildtools >> >> >> I'm looking for a way to centralize the population of these top level >> groups; meaning, no matter what inventory is used, all hosts in >> jenkins_masters and jenkins_slaves are added to jenkins_servers. >> >> When using dynamic inventory, I found it was very convenient to add a >> static inventory file called rollup_groups that contains no hosts, but just: >> >> [jenkins_masters] >> [jenkins_slaves] >> >> [jenkins_servers:children] >> jenkins_masters >> jenkins_slaves >> >> When referring to the directory that contains this and the dynamic >> inventory script, the hosts and basic group membership come from the cloud, >> and the parent group gets taken care by this file. >> >> To re-use this same method with static host inventories, the only way I >> can see is to put each inventory file in a separate directory along with a >> copy of rollup groups. But I don't feel awesome about that solution - >> having many copies of the same file bothers me. >> >> Does anybody have ideas about how else to tackle this? >> >> Thanks, >> >> Matt >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ansible Project" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/ansible-project/dee38b05-527f-4176-984a-ea385a0b96ca%40googlegroups.com >> >> <https://groups.google.com/d/msgid/ansible-project/dee38b05-527f-4176-984a-ea385a0b96ca%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/67cd82de-033b-44c8-bfa4-879dca63c14b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
