Skip to content

Commit

Permalink
Move rabbitmq precheck from start
Browse files Browse the repository at this point in the history
rabbitmq's start task contains a precheck. This should be part of the
other prechecks for consistency

TrivialFix

Change-Id: I7728ec3f5be3248424d74a4387925b72114b8943
  • Loading branch information
Paul Bourke committed Aug 26, 2016
1 parent ca100f1 commit 6c238ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 10 additions & 0 deletions ansible/roles/prechecks/tasks/port_checks.yml
Expand Up @@ -343,6 +343,16 @@
state: stopped
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
wait_for:
host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
Expand Down
10 changes: 0 additions & 10 deletions ansible/roles/rabbitmq/tasks/bootstrap.yml
@@ -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
kolla_docker:
action: "create_volume"
Expand Down

0 comments on commit 6c238ca

Please sign in to comment.