From 82b5dc643d1d1325dd3103abb759071a07e182d2 Mon Sep 17 00:00:00 2001 From: caoyuan Date: Fri, 24 Feb 2017 11:13:04 +0800 Subject: [PATCH] Add the missing prechecks for placement_api Change-Id: Ic3cbf89b135a1902fa57a8d1df8c858cd6398097 --- ansible/roles/haproxy/tasks/precheck.yml | 11 +++++++++++ ansible/roles/nova/tasks/precheck.yml | 14 ++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/ansible/roles/haproxy/tasks/precheck.yml b/ansible/roles/haproxy/tasks/precheck.yml index e46aa7626a..33b375b7d1 100644 --- a/ansible/roles/haproxy/tasks/precheck.yml +++ b/ansible/roles/haproxy/tasks/precheck.yml @@ -391,6 +391,17 @@ - inventory_hostname in groups['haproxy'] - "{{ 'nova_spicehtml5proxy' not in haproxy_stat }}" +- name: Checking free port for Nova Placement API HAProxy + wait_for: + host: "{{ kolla_internal_vip_address }}" + port: "{{ placement_api_port }}" + connect_timeout: 1 + state: stopped + when: + - enable_nova | bool + - inventory_hostname in groups['haproxy'] + - "{{ 'placement_api' not in haproxy_stat }}" + - name: Checking free port for Octavia API HAProxy wait_for: host: "{{ kolla_internal_vip_address }}" diff --git a/ansible/roles/nova/tasks/precheck.yml b/ansible/roles/nova/tasks/precheck.yml index 743ff8fa1d..a1f5004210 100644 --- a/ansible/roles/nova/tasks/precheck.yml +++ b/ansible/roles/nova/tasks/precheck.yml @@ -6,6 +6,7 @@ - nova_novncproxy - nova_serialproxy - nova_spicehtml5proxy + - placement_api register: container_facts - name: Checking free port for Nova API @@ -72,3 +73,16 @@ - container_facts['nova_spicehtml5proxy'] is not defined - nova_spicehtml5proxy.enabled | bool - inventory_hostname in groups[nova_spicehtml5proxy.group] + +- name: Checking free port for Nova Placement API + vars: + placement_api: "{{ nova_services['placement-api'] }}" + wait_for: + host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + port: "{{ placement_api_port }}" + connect_timeout: 1 + state: stopped + when: + - container_facts['placement_api'] is not defined + - inventory_hostname in groups[placement_api.group] + - placement_api.enabled | bool