On Friday, March 7, 2014 8:42:24 AM UTC-8, James Martin wrote:
>
> You can create dynamic groups by using the group_by module:
>
> - name: Create groups based on location
> group_by: key={{ location }}
>
>
I have to say that group_by is a very useful module if you are trying to
keep your inventory minimal, but want to be able to sleect servers based on
common characteristics (networks, operating systems, hardware types and so
on. I suspect that you could combine group_by and local facts to easily
achieve what you want...
Create an /etc/ansible/local/facts.d with a location fact in it and then
you can use that in your group_by quite happily...
Adam
--
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/1e95c8cb-79aa-4be3-8bd8-a3db4cd99612%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.