From eeac3134b381a3b519f861a829488bceabe25da0 Mon Sep 17 00:00:00 2001 From: caoyuan Date: Tue, 27 Dec 2016 14:42:07 +0800 Subject: [PATCH] Move murano precheck into its own role Change-Id: I3a2b6869a7742c5bf91c3dc20523784aca0eb521 Partially-implements: blueprint condition-pre-check --- ansible/roles/haproxy/tasks/precheck.yml | 11 ++++++++++ ansible/roles/murano/tasks/precheck.yml | 15 ++++++++++++++ ansible/roles/prechecks/tasks/port_checks.yml | 20 ------------------- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/ansible/roles/haproxy/tasks/precheck.yml b/ansible/roles/haproxy/tasks/precheck.yml index 8578b2820d..c287c1c6e8 100644 --- a/ansible/roles/haproxy/tasks/precheck.yml +++ b/ansible/roles/haproxy/tasks/precheck.yml @@ -212,6 +212,17 @@ - "{{ 'mistral_api' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] +- name: Checking free port for Murano API HAProxy + wait_for: + host: "{{ kolla_internal_vip_address }}" + port: "{{ murano_api_port }}" + connect_timeout: 1 + state: stopped + when: + - enable_murano | bool + - "{{ 'murano_api' not in haproxy_stat }}" + - inventory_hostname in groups['haproxy'] + - name: Checking free port for Neutron Server HAProxy wait_for: host: "{{ kolla_internal_vip_address }}" diff --git a/ansible/roles/murano/tasks/precheck.yml b/ansible/roles/murano/tasks/precheck.yml index ed97d539c0..f6137d4e7c 100644 --- a/ansible/roles/murano/tasks/precheck.yml +++ b/ansible/roles/murano/tasks/precheck.yml @@ -1 +1,16 @@ --- +- name: Get container facts + kolla_container_facts: + name: + - murano_api + register: container_facts + +- name: Checking free port for Murano API + wait_for: + host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + port: "{{ murano_api_port }}" + connect_timeout: 1 + state: stopped + when: + - container_facts['murano_api'] is not defined + - inventory_hostname in groups['murano-api'] diff --git a/ansible/roles/prechecks/tasks/port_checks.yml b/ansible/roles/prechecks/tasks/port_checks.yml index 06a8a79dbe..ce6a55d7b8 100644 --- a/ansible/roles/prechecks/tasks/port_checks.yml +++ b/ansible/roles/prechecks/tasks/port_checks.yml @@ -193,26 +193,6 @@ - enable_mariadb | bool - inventory_hostname in groups['mariadb'] -- name: Checking free port for Murano API - wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" - port: "{{ murano_api_port }}" - connect_timeout: 1 - state: stopped - when: - - enable_murano | bool - - inventory_hostname in groups['murano-api'] - -- name: Checking free port for Murano API HAProxy - wait_for: - host: "{{ kolla_internal_vip_address }}" - port: "{{ murano_api_port }}" - connect_timeout: 1 - state: stopped - when: - - enable_murano | bool - - inventory_hostname in groups['haproxy'] - - name: Checking free port for RabbitMQ wait_for: host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"