Skip to content
Snippets Groups Projects
Commit d2f828a1 authored by Michal (inc0) Jastrzebski's avatar Michal (inc0) Jastrzebski
Browse files

Add check if all the hostnames are resolvable

Rabbitmq can't work with IPs, so we need to make sure that all
rabbit cluster hosts can resolve each others hostnames. We
should also require that in docs.

DocImpact
Closes-Bug: #1559158

Change-Id: I2418187138988d21da3dc3624e9cdbda891d4894
parent db0de9b7
No related branches found
No related tags found
No related merge requests found
---
- 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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment