Cuong Nguyen 2bcf76646b Use group_names to check a host belongs to group
group_names is one of magic variables from Ansible [1] which is a
list of all groups the current host is in, using this syntax will be
more readable and avoid assuming that specific group is already defined
in inventory. Another use case is if we want to run a task only if the
host does not belong to a certain group.

This also makes consitent with some usages in current code [2].

[1]
http://docs.ansible.com/ansible/latest/playbooks_variables.html#magic-variables-and-how-to-access-information-about-other-hosts
[2]
https://github.com/openstack/openstack-ansible-os_cinder/blob/master/tasks/main.yml#L70

Change-Id: I7f85e18829cd3c9835f592ceb74f4e6460208ca6
2017-11-16 17:44:41 +07:00
..
2017-08-02 15:12:17 -05:00