Merge "Add check if all the hostnames are resolvable"

This commit is contained in:
Jenkins 2016-03-21 02:10:36 +00:00 committed by Gerrit Code Review
commit fa2b14a69a

View File

@ -1,4 +1,14 @@
---
- name: Check if all rabbit hostnames are resolvable
command: "getent hosts {{ hostvars[item]['ansible_hostname'] }}"
changed_when: false
register: rabbitmq_hostnames
with_items: groups['rabbitmq']
- fail: msg="Hostname has to resolve to IP address of api_interface"
with_items: rabbitmq_hostnames.results
when: "{% set ip=item.stdout.split(' ')[0] %}'{{ hostvars[item['item']]['ansible_' + hostvars[item['item']]['api_interface']]['ipv4']['address'] }}' != '{{ ip }}'"
- name: Creating rabbitmq volume
kolla_docker:
action: "create_volume"