Move congress precheck into its own role

Change-Id: I775b039a07daf27460fa288ecb2886417513f411
Partially-implements: blueprint condition-pre-check
This commit is contained in:
caoyuan 2016-12-22 16:42:56 +08:00
parent e1ed40bc79
commit dba142e8b7
3 changed files with 26 additions and 20 deletions

View File

@ -1 +1,16 @@
---
- name: Get container facts
kolla_container_facts:
name:
- congress_api
register: container_facts
- name: Checking free port for Congress API
wait_for:
host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
port: "{{ congress_api_port }}"
connect_timeout: 1
state: stopped
when:
- container_facts['congress_api'] is not defined
- inventory_hostname in groups['congress-api']

View File

@ -69,6 +69,17 @@
- "{{ 'cloudkitty_api' not in haproxy_stat }}"
- inventory_hostname in groups['haproxy']
- name: Checking free port for Congress API HAProxy
wait_for:
host: "{{ kolla_internal_vip_address }}"
port: "{{ congress_api_port }}"
connect_timeout: 1
state: stopped
when:
- enable_congress | bool
- "{{ 'congress_api' not in haproxy_stat }}"
- inventory_hostname in groups['haproxy']
- name: Checking free port for Designate API HAProxy
wait_for:
host: "{{ kolla_internal_vip_address }}"

View File

@ -33,26 +33,6 @@
kolla_internal_vip_address | ipaddr(ip_addr_output.stdout.split()[3]) is none"
when: enable_haproxy | bool
- name: Checking free port for Congress API
wait_for:
host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
port: "{{ congress_api_port }}"
connect_timeout: 1
state: stopped
when:
- enable_congress | bool
- inventory_hostname in groups['congress-api']
- name: Checking free port for Congress API HAProxy
wait_for:
host: "{{ kolla_internal_vip_address }}"
port: "{{ congress_api_port }}"
connect_timeout: 1
state: stopped
when:
- enable_congress | bool
- inventory_hostname in groups['haproxy']
- name: Checking free port for Etcd Peer
wait_for:
host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"