0down votefavorite
<http://stackoverflow.com/questions/38571141/dynamic-groups-based-on-ip-range-in-ansible-groups#>
How to create variable group based on ip address-range in ansible inventory
groups ? I have two groups of servers in different location. I want to
create the two groups based on their IP range (two ranges for two
locations) . I already have groups based on distribution, prod, dev, test,
qa ,dr in my host inventory. I know I can create a thr grouping using
group_by. But How do I call them ? and How to assign a custom variable name
to them ?
- hosts: all
tasks:
- group_by: key=network_{{ ansible_default_ipv4.network }}
But how do I call them ? and How to assign a custom
variable name to them ? Is there a way that I
could create a group once and store all the hosts in a
static inventory file. ?
--
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/ab981f6a-72c2-4df2-a514-79664f97572e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.