Move sahara precheck into its own role

Change-Id: I58d86ffb8001f54a3748fcd7fbabfeb5b873102c
Partially-implements: blueprint condition-pre-check
This commit is contained in:
caoyuan 2017-01-02 21:21:33 +08:00
parent 38c3dbf5d8
commit 1c246219be
3 changed files with 26 additions and 20 deletions

View File

@ -101,3 +101,14 @@
- enable_manila | bool
- "{{ 'manila_api' not in haproxy_stat }}"
- inventory_hostname in groups['haproxy']
- name: Checking free port for Sahara API HAProxy
wait_for:
host: "{{ kolla_internal_vip_address }}"
port: "{{ sahara_api_port }}"
connect_timeout: 1
state: stopped
when:
- enable_sahara | bool
- "{{ 'sahara_api' not in haproxy_stat }}"
- inventory_hostname in groups['haproxy']

View File

@ -163,26 +163,6 @@
- enable_kuryr | bool
- inventory_hostname in groups['compute']
- name: Checking free port for Sahara API
wait_for:
host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
port: "{{ sahara_api_port }}"
connect_timeout: 1
state: stopped
when:
- enable_sahara | bool
- inventory_hostname in groups['sahara-api']
- name: Checking free port for Sahara API HAProxy
wait_for:
host: "{{ kolla_internal_vip_address }}"
port: "{{ sahara_api_port }}"
connect_timeout: 1
state: stopped
when:
- enable_sahara | bool
- inventory_hostname in groups['haproxy']
- name: Checking free port for HAProxy stats
wait_for:
host: "{{ kolla_internal_vip_address }}"

View File

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