From b5c0f0628ad50384466dd45041ca66b6aa74eacf Mon Sep 17 00:00:00 2001 From: Eduardo Gonzalez Date: Wed, 28 Dec 2016 17:53:51 +0100 Subject: [PATCH] Unify haproxy prechecks condition order Unify order on all precheck tasks to use the same. Add the missing solum condition prchecks and keep the location by alphabet. Co-Authored-By: Mauricio Lima Co-Authored-By: Francisco Edigleison Barbosa Co-Authored-By: caoyuan Change-Id: I8f48cc269b0ee8092b36b310baf4680c046c53a5 Partially-implements: blueprint condition-pre-check --- ansible/roles/haproxy/tasks/precheck.yml | 142 ++++++++++++----------- 1 file changed, 72 insertions(+), 70 deletions(-) diff --git a/ansible/roles/haproxy/tasks/precheck.yml b/ansible/roles/haproxy/tasks/precheck.yml index 90d3d3b99e..974da91e0f 100644 --- a/ansible/roles/haproxy/tasks/precheck.yml +++ b/ansible/roles/haproxy/tasks/precheck.yml @@ -22,8 +22,8 @@ state: stopped when: - enable_aodh | bool - - "{{ 'aodh_api' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'aodh_api' not in haproxy_stat }}" - name: Checking free port for Barbican API HAProxy wait_for: @@ -33,8 +33,8 @@ state: stopped when: - enable_barbican | bool - - "{{ 'barbican_api' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'barbican_api' not in haproxy_stat }}" - name: Checking free port for Ceilometer API HAProxy wait_for: @@ -44,8 +44,8 @@ state: stopped when: - enable_ceilometer | bool - - "{{ 'ceilometer_api' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'ceilometer_api' not in haproxy_stat }}" - name: Checking free port for Cinder API HAProxy wait_for: @@ -55,8 +55,8 @@ state: stopped when: - enable_cinder | bool - - "{{ 'cinder_api' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'cinder_api' not in haproxy_stat }}" - name: Checking free port for Cloudkitty API HAProxy wait_for: @@ -66,8 +66,8 @@ state: stopped when: - enable_cloudkitty | bool - - "{{ 'cloudkitty_api' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'cloudkitty_api' not in haproxy_stat }}" - name: Checking free port for Congress API HAProxy wait_for: @@ -77,8 +77,8 @@ state: stopped when: - enable_congress | bool - - "{{ 'congress_api' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'congress_api' not in haproxy_stat }}" - name: Checking free port for Designate API HAProxy wait_for: @@ -99,8 +99,8 @@ state: stopped when: - enable_elasticsearch | bool - - "{{ 'elasticsearch' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'elasticsearch' not in haproxy_stat }}" - name: Checking free port for Glance API HAProxy wait_for: @@ -132,8 +132,8 @@ state: stopped when: - enable_gnocchi | bool - - "{{ 'gnocchi_api' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'gnocchi_api' not in haproxy_stat }}" - name: Checking free port for Grafana server HAProxy wait_for: @@ -143,8 +143,8 @@ state: stopped when: - enable_grafana | bool - - "{{ 'grafana_server' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'grafana_server' not in haproxy_stat }}" - name: Checking free port for Heat API HAProxy wait_for: @@ -154,8 +154,8 @@ state: stopped when: - enable_heat | bool - - "{{ 'heat_api' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'heat_api' not in haproxy_stat }}" - name: Checking free port for Heat API CFN HAProxy wait_for: @@ -165,8 +165,8 @@ state: stopped when: - enable_heat | bool - - "{{ 'heat_api_cfn' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'heat_api_cfn' not in haproxy_stat }}" - name: Checking free port for Horizon HAProxy wait_for: @@ -176,8 +176,8 @@ state: stopped when: - enable_horizon | bool - - "{{ 'horizon' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'horizon' not in haproxy_stat }}" - name: Checking free port for Ironic HAProxy wait_for: @@ -187,40 +187,8 @@ state: stopped when: - enable_ironic | bool + - inventory_hostname in groups['haproxy'] - "{{ 'ironic_api' not in haproxy_stat }}" - - inventory_hostname in groups['haproxy'] - -- name: Checking free port for Keystone Admin HAProxy - wait_for: - host: "{{ kolla_internal_vip_address }}" - port: "{{ keystone_admin_port }}" - connect_timeout: 1 - state: stopped - when: - - enable_keystone | bool - - "{{ 'keystone_admin' not in haproxy_stat }}" - - inventory_hostname in groups['haproxy'] - -- name: Checking free port for Keystone Internal HAProxy - wait_for: - host: "{{ kolla_internal_vip_address }}" - port: "{{ keystone_public_port }}" - connect_timeout: 1 - state: stopped - when: - - enable_keystone | bool - - "{{ 'keystone_internal' not in haproxy_stat }}" - - inventory_hostname in groups['haproxy'] - -- name: Checking free port for Keystone Public HAProxy - wait_for: - host: "{{ kolla_external_vip_address }}" - port: "{{ keystone_public_port }}" - connect_timeout: 1 - state: stopped - when: - - enable_keystone | bool - - "{{ 'keystone_external' not in haproxy_stat }}" - name: Checking free port for Karbor Admin HAProxy wait_for: @@ -230,8 +198,41 @@ state: stopped when: - enable_karbor | bool - - "{{ 'karbor_api' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'karbor_api' not in haproxy_stat }}" + +- name: Checking free port for Keystone Admin HAProxy + wait_for: + host: "{{ kolla_internal_vip_address }}" + port: "{{ keystone_admin_port }}" + connect_timeout: 1 + state: stopped + when: + - enable_keystone | bool + - inventory_hostname in groups['haproxy'] + - "{{ 'keystone_admin' not in haproxy_stat }}" + +- name: Checking free port for Keystone Internal HAProxy + wait_for: + host: "{{ kolla_internal_vip_address }}" + port: "{{ keystone_public_port }}" + connect_timeout: 1 + state: stopped + when: + - enable_keystone | bool + - inventory_hostname in groups['haproxy'] + - "{{ 'keystone_internal' not in haproxy_stat }}" + +- name: Checking free port for Keystone Public HAProxy + wait_for: + host: "{{ kolla_external_vip_address }}" + port: "{{ keystone_public_port }}" + connect_timeout: 1 + state: stopped + when: + - enable_keystone | bool + - inventory_hostname in groups['haproxy'] + - "{{ 'keystone_external' not in haproxy_stat }}" - name: Checking free port for Kibana HAProxy wait_for: @@ -241,8 +242,8 @@ state: stopped when: - enable_kibana | bool - - "{{ 'kibana' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'kibana' not in haproxy_stat }}" - name: Checking free port for Magnum API HAProxy wait_for: @@ -252,8 +253,8 @@ state: stopped when: - enable_magnum | bool - - "{{ 'magnum_api' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'magnum_api' not in haproxy_stat }}" - name: Checking free port for Manila API HAProxy wait_for: @@ -263,8 +264,8 @@ state: stopped when: - enable_manila | bool - - "{{ 'manila_api' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'manila_api' not in haproxy_stat }}" - name: Checking free port for MariaDB HAProxy wait_for: @@ -274,8 +275,8 @@ state: stopped when: - enable_mariadb | bool - - "{{ 'mariadb' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'mariadb' not in haproxy_stat }}" - name: Checking free port for Mistral API HAProxy wait_for: @@ -285,8 +286,8 @@ state: stopped when: - enable_mistral | bool - - "{{ 'mistral_api' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'mistral_api' not in haproxy_stat }}" - name: Checking free port for Mongodb HAProxy wait_for: @@ -296,8 +297,8 @@ state: stopped when: - enable_mongodb | bool - - "{{ 'mongodb' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'mongodb' not in haproxy_stat }}" - name: Checking free port for Murano API HAProxy wait_for: @@ -307,8 +308,8 @@ state: stopped when: - enable_murano | bool - - "{{ 'murano_api' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'murano_api' not in haproxy_stat }}" - name: Checking free port for Neutron Server HAProxy wait_for: @@ -318,8 +319,8 @@ state: stopped when: - enable_neutron | bool - - "{{ 'neutron_server' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'neutron_server' not in haproxy_stat }}" - name: Checking free port for Nova API HAProxy wait_for: @@ -329,8 +330,8 @@ state: stopped when: - enable_nova | bool - - "{{ 'nova_api' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'nova_api' not in haproxy_stat }}" - name: Checking free port for Nova Metadata HAProxy wait_for: @@ -340,8 +341,8 @@ state: stopped when: - enable_nova | bool - - "{{ 'nova_metadata' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'nova_metadata' not in haproxy_stat }}" - name: Checking free port for Nova NoVNC HAProxy wait_for: @@ -351,9 +352,9 @@ state: stopped when: - enable_nova | bool - - "{{ 'nova_novncproxy' not in haproxy_stat }}" - nova_console == 'novnc' - inventory_hostname in groups['haproxy'] + - "{{ 'nova_novncproxy' not in haproxy_stat }}" - name: Checking free port for Nova Spice HTML5 HAProxy wait_for: @@ -363,9 +364,9 @@ state: stopped when: - enable_nova | bool - - "{{ 'nova_spicehtml5proxy' not in haproxy_stat }}" - nova_console == 'spice' - inventory_hostname in groups['haproxy'] + - "{{ 'nova_spicehtml5proxy' not in haproxy_stat }}" - name: Checking free port for Octavia API HAProxy wait_for: @@ -375,8 +376,8 @@ state: stopped when: - enable_octavia | bool - - "{{ 'octavia_api' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'octavia_api' not in haproxy_stat }}" - name: Checking free port for Panko API HAProxy wait_for: @@ -386,8 +387,8 @@ state: stopped when: - enable_panko | bool - - "{{ 'panko_api' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'panko_api' not in haproxy_stat }}" - name: Checking free port for RabbitMQ Management HAProxy wait_for: @@ -397,8 +398,8 @@ state: stopped when: - enable_rabbitmq | bool - - "{{ 'rabbitmq_management' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'rabbitmq_management' not in haproxy_stat }}" - name: Checking free port for RadosGW HAProxy wait_for: @@ -408,8 +409,8 @@ state: stopped when: - enable_ceph_rgw | bool - - "{{ 'radosgw' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'radosgw' not in haproxy_stat }}" - name: Checking free port for Sahara API HAProxy wait_for: @@ -419,8 +420,8 @@ state: stopped when: - enable_sahara | bool - - "{{ 'sahara_api' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'sahara_api' not in haproxy_stat }}" - name: Checking free port for Searchlight API HAProxy wait_for: @@ -430,8 +431,8 @@ state: stopped when: - enable_searchlight | bool - - "{{ 'searchlight_api' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'searchlight_api' not in haproxy_stat }}" - name: Checking free port for Senlin API HAProxy wait_for: @@ -441,8 +442,8 @@ state: stopped when: - enable_senlin | bool - - "{{ 'senlin_api' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'senlin_api' not in haproxy_stat }}" - name: Checking free port for Solum Application Deployment HAProxy wait_for: @@ -452,8 +453,8 @@ state: stopped when: - enable_solum | bool - - "{{ 'solum_application_deployment' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'solum_application_deployment' not in haproxy_stat }}" - name: Checking free port for Solum Image Builder HAProxy wait_for: @@ -463,6 +464,7 @@ state: stopped when: - enable_solum | bool + - inventory_hostname in groups['haproxy'] - "{{ 'solum_image_builder' not in haproxy_stat }}" - name: Checking free port for Swift Proxy Server HAProxy @@ -473,8 +475,8 @@ state: stopped when: - enable_swift | bool - - "{{ 'swift_api' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'swift_api' not in haproxy_stat }}" - name: Checking free port for Tacker Server HAProxy wait_for: @@ -484,8 +486,8 @@ state: stopped when: - enable_tacker | bool - - "{{ 'tacker_server' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'tacker_server' not in haproxy_stat }}" - name: Checking free port for Trove API HAProxy wait_for: @@ -495,8 +497,8 @@ state: stopped when: - enable_trove | bool - - "{{ 'trove_api' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'trove_api' not in haproxy_stat }}" - name: Checking free port for Watcher API HAProxy wait_for: @@ -506,5 +508,5 @@ state: stopped when: - enable_watcher | bool - - "{{ 'watcher_api' not in haproxy_stat }}" - inventory_hostname in groups['haproxy'] + - "{{ 'watcher_api' not in haproxy_stat }}"