Hi,
I’m pulling my hair out on this, but it’s probably something simple. I’m trying to create a dynamic group that has all our OpenVZ Guests in it.
So, in my ‘site.yml’ I have:
`
- name: Setup Groups
hosts: all
tasks: - name: Create Groups based on OS
group_by: key=dist_{{ ansible_distribution }} - name: Create VZ Guest Group
group_by: key={{ ansible_virtualization_type }}-{{ ansible_virtualization_role }}
`
My problem is, it seems to be putting every host in this group:
TASK: [Create VZ Guest Group] ************************************************* changed: [hostx.umaryland.edu] => {"changed": true, "groups": {"openvz-guest": ["hostx", "hosty", "hostz"]}}
‘hostz’ is definitely not a OpenVZ guest- in fact, if you run the ‘setup’ module against hostz, ‘ansible_virtualization_type’ and ‘ansible_virtualization_role’ aren’t even returned in the output.
For what it’s worth, I’m running ansible 1.4.3 from the EPEL repository.
What am I missing? I’m referencing:
https://github.com/ansible/ansible-examples/blob/master/language_features/group_by.yml
and
http://docs.ansible.com/group_by_module.html
Thanks,
Matt