Merge "Move rabbitmq precheck from start"

This commit is contained in:
Jenkins 2016-08-26 19:04:42 +00:00 committed by Gerrit Code Review
commit 8874c69beb
2 changed files with 10 additions and 10 deletions

View File

@ -343,6 +343,16 @@
state: stopped state: stopped
when: inventory_hostname in groups['rabbitmq'] when: inventory_hostname in groups['rabbitmq']
- name: Check if all rabbit hostnames are resolvable
command: "getent ahostsv4 {{ 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: "'{{ hostvars[item['item']]['ansible_' + hostvars[item['item']]['api_interface']]['ipv4']['address'] }}' not in '{{ item.stdout }}'"
- name: Checking free port for Mongodb - name: Checking free port for Mongodb
wait_for: wait_for:
host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"

View File

@ -1,14 +1,4 @@
--- ---
- name: Check if all rabbit hostnames are resolvable
command: "getent ahostsv4 {{ 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: "'{{ hostvars[item['item']]['ansible_' + hostvars[item['item']]['api_interface']]['ipv4']['address'] }}' not in '{{ item.stdout }}'"
- name: Creating rabbitmq volume - name: Creating rabbitmq volume
kolla_docker: kolla_docker:
action: "create_volume" action: "create_volume"