Rewrite haproxy precheck conditions to not use string interpolation

In Ansible 2.3.0 when statements should not include jinja2 templating
delimiters such as {{ }} or {% %}

This patchset fixes all condition in precheck task of haproxy.

Change-Id: I5ad234cf24133efe342956c1b7ab1b947f96b20f
Partial-Bug: #1695142
This commit is contained in:
Duong Ha-Quang 2017-06-02 13:04:56 +07:00
parent 5683b71845
commit dbedf6b659

View File

@ -90,7 +90,7 @@
when:
- enable_aodh | bool
- inventory_hostname in groups['haproxy']
- "{{ 'aodh_api' not in haproxy_stat }}"
- haproxy_stat.find('aodh_api') == -1
- name: Checking free port for Barbican API HAProxy
wait_for:
@ -102,7 +102,7 @@
when:
- enable_barbican | bool
- inventory_hostname in groups['haproxy']
- "{{ 'barbican_api' not in haproxy_stat }}"
- haproxy_stat.find('barbican_api') == -1
- name: Checking free port for Ceilometer API HAProxy
wait_for:
@ -114,7 +114,7 @@
when:
- enable_ceilometer | bool
- inventory_hostname in groups['haproxy']
- "{{ 'ceilometer_api' not in haproxy_stat }}"
- haproxy_stat.find('ceilometer_api') == -1
- name: Checking free port for Cinder API HAProxy
wait_for:
@ -126,7 +126,7 @@
when:
- enable_cinder | bool
- inventory_hostname in groups['haproxy']
- "{{ 'cinder_api' not in haproxy_stat }}"
- haproxy_stat.find('cinder_api') == -1
- name: Checking free port for Cloudkitty API HAProxy
wait_for:
@ -138,7 +138,7 @@
when:
- enable_cloudkitty | bool
- inventory_hostname in groups['haproxy']
- "{{ 'cloudkitty_api' not in haproxy_stat }}"
- haproxy_stat.find('cloudkitty_api') == -1
- name: Checking free port for Congress API HAProxy
wait_for:
@ -150,7 +150,7 @@
when:
- enable_congress | bool
- inventory_hostname in groups['haproxy']
- "{{ 'congress_api' not in haproxy_stat }}"
- haproxy_stat.find('congress_api') == -1
- name: Checking free port for Designate API HAProxy
wait_for:
@ -162,7 +162,7 @@
when:
- enable_designate | bool
- inventory_hostname in groups['haproxy']
- "{{ 'designate_api' not in haproxy_stat }}"
- haproxy_stat.find('designate_api') == -1
- name: Checking free port for Elasticsearch HAProxy
wait_for:
@ -174,7 +174,7 @@
when:
- enable_elasticsearch | bool
- inventory_hostname in groups['haproxy']
- "{{ 'elasticsearch' not in haproxy_stat }}"
- haproxy_stat.find('elasticsearch') == -1
- name: Checking free port for Glance API HAProxy
wait_for:
@ -186,7 +186,7 @@
when:
- enable_glance | bool
- inventory_hostname in groups['haproxy']
- "{{ 'glance_api' not in haproxy_stat }}"
- haproxy_stat.find('glance_api') == -1
- name: Checking free port for Glance Registry HAProxy
wait_for:
@ -198,7 +198,7 @@
when:
- enable_glance | bool
- inventory_hostname in groups['haproxy']
- "{{ 'glance_registry' not in haproxy_stat }}"
- haproxy_stat.find('glance_registry') == -1
- name: Checking free port for Gnocchi API HAProxy
wait_for:
@ -210,7 +210,7 @@
when:
- enable_gnocchi | bool
- inventory_hostname in groups['haproxy']
- "{{ 'gnocchi_api' not in haproxy_stat }}"
- haproxy_stat.find('gnocchi_api') == -1
- name: Checking free port for Freezer API HAProxy
wait_for:
@ -221,7 +221,7 @@
state: stopped
when:
- enable_freezer | bool
- "{{ 'freezer_api' not in haproxy_stat }}"
- haproxy_stat.find('freezer_api') == -1
- inventory_hostname in groups['haproxy']
- name: Checking free port for Grafana server HAProxy
@ -234,7 +234,7 @@
when:
- enable_grafana | bool
- inventory_hostname in groups['haproxy']
- "{{ 'grafana_server' not in haproxy_stat }}"
- haproxy_stat.find('grafana_server') == -1
- name: Checking free port for Heat API HAProxy
wait_for:
@ -246,7 +246,7 @@
when:
- enable_heat | bool
- inventory_hostname in groups['haproxy']
- "{{ 'heat_api' not in haproxy_stat }}"
- haproxy_stat.find('heat_api') == -1
- name: Checking free port for Heat API CFN HAProxy
wait_for:
@ -258,7 +258,7 @@
when:
- enable_heat | bool
- inventory_hostname in groups['haproxy']
- "{{ 'heat_api_cfn' not in haproxy_stat }}"
- haproxy_stat.find('heat_api_cfn') == -1
- name: Checking free port for Horizon HAProxy
wait_for:
@ -270,7 +270,7 @@
when:
- enable_horizon | bool
- inventory_hostname in groups['haproxy']
- "{{ 'horizon' not in haproxy_stat }}"
- haproxy_stat.find('horizon') == -1
- name: Checking free port for Ironic API HAProxy
wait_for:
@ -282,7 +282,7 @@
when:
- enable_ironic | bool
- inventory_hostname in groups['haproxy']
- "{{ 'ironic_api' not in haproxy_stat }}"
- haproxy_stat.find('ironic_api') == -1
- name: Checking free port for Ironic Inspector HAProxy
wait_for:
@ -294,7 +294,7 @@
when:
- enable_ironic | bool
- inventory_hostname in groups['haproxy']
- "{{ 'ironic_inspector' not in haproxy_stat }}"
- haproxy_stat.find('ironic_inspector') == -1
- name: Checking free port for Karbor Admin HAProxy
wait_for:
@ -306,7 +306,7 @@
when:
- enable_karbor | bool
- inventory_hostname in groups['haproxy']
- "{{ 'karbor_api' not in haproxy_stat }}"
- haproxy_stat.find('karbor_api') == -1
- name: Checking free port for Keystone Admin HAProxy
wait_for:
@ -318,7 +318,7 @@
when:
- enable_keystone | bool
- inventory_hostname in groups['haproxy']
- "{{ 'keystone_admin' not in haproxy_stat }}"
- haproxy_stat.find('keystone_admin') == -1
- name: Checking free port for Keystone Internal HAProxy
wait_for:
@ -330,7 +330,7 @@
when:
- enable_keystone | bool
- inventory_hostname in groups['haproxy']
- "{{ 'keystone_internal' not in haproxy_stat }}"
- haproxy_stat.find('keystone_internal') == -1
- name: Checking free port for Keystone Public HAProxy
wait_for:
@ -343,7 +343,7 @@
- haproxy_enable_external_vip | bool
- enable_keystone | bool
- inventory_hostname in groups['haproxy']
- "{{ 'keystone_external' not in haproxy_stat }}"
- haproxy_stat.find('keystone_external') == -1
- name: Checking free port for Kibana HAProxy
wait_for:
@ -355,7 +355,7 @@
when:
- enable_kibana | bool
- inventory_hostname in groups['haproxy']
- "{{ 'kibana' not in haproxy_stat }}"
- haproxy_stat.find('kibana') == -1
- name: Checking free port for Magnum API HAProxy
wait_for:
@ -367,7 +367,7 @@
when:
- enable_magnum | bool
- inventory_hostname in groups['haproxy']
- "{{ 'magnum_api' not in haproxy_stat }}"
- haproxy_stat.find('magnum_api') == -1
- name: Checking free port for Manila API HAProxy
wait_for:
@ -379,7 +379,7 @@
when:
- enable_manila | bool
- inventory_hostname in groups['haproxy']
- "{{ 'manila_api' not in haproxy_stat }}"
- haproxy_stat.find('manila_api') == -1
- name: Checking free port for MariaDB HAProxy
wait_for:
@ -391,7 +391,7 @@
when:
- enable_mariadb | bool
- inventory_hostname in groups['haproxy']
- "{{ 'mariadb' not in haproxy_stat }}"
- haproxy_stat.find('mariadb') == -1
- name: Checking free port for Mistral API HAProxy
wait_for:
@ -403,7 +403,7 @@
when:
- enable_mistral | bool
- inventory_hostname in groups['haproxy']
- "{{ 'mistral_api' not in haproxy_stat }}"
- haproxy_stat.find('mistral_api') == -1
- name: Checking free port for Mongodb HAProxy
wait_for:
@ -415,7 +415,7 @@
when:
- enable_mongodb | bool
- inventory_hostname in groups['haproxy']
- "{{ 'mongodb' not in haproxy_stat }}"
- haproxy_stat.find('mongodb') == -1
- name: Checking free port for Murano API HAProxy
wait_for:
@ -427,7 +427,7 @@
when:
- enable_murano | bool
- inventory_hostname in groups['haproxy']
- "{{ 'murano_api' not in haproxy_stat }}"
- haproxy_stat.find('murano_api') == -1
- name: Checking free port for Neutron Server HAProxy
wait_for:
@ -439,7 +439,7 @@
when:
- enable_neutron | bool
- inventory_hostname in groups['haproxy']
- "{{ 'neutron_server' not in haproxy_stat }}"
- haproxy_stat.find('neutron_server') == -1
- name: Checking free port for Nova API HAProxy
wait_for:
@ -451,7 +451,7 @@
when:
- enable_nova | bool
- inventory_hostname in groups['haproxy']
- "{{ 'nova_api' not in haproxy_stat }}"
- haproxy_stat.find('nova_api') == -1
- name: Checking free port for Nova Metadata HAProxy
wait_for:
@ -463,7 +463,7 @@
when:
- enable_nova | bool
- inventory_hostname in groups['haproxy']
- "{{ 'nova_metadata' not in haproxy_stat }}"
- haproxy_stat.find('nova_metadata') == -1
- name: Checking free port for Nova NoVNC HAProxy
wait_for:
@ -476,7 +476,7 @@
- enable_nova | bool
- nova_console == 'novnc'
- inventory_hostname in groups['haproxy']
- "{{ 'nova_novncproxy' not in haproxy_stat }}"
- haproxy_stat.find('nova_novncproxy') == -1
- name: Checking free port for Nova Serial Proxy HAProxy
wait_for:
@ -487,7 +487,7 @@
state: stopped
when:
- enable_nova | bool
- "{{ 'nova_serialconsole_proxy' not in haproxy_stat }}"
- haproxy_stat.find('nova_serialconsole_proxy') == -1
- enable_nova_serialconsole_proxy | bool
- inventory_hostname in groups['haproxy']
@ -502,7 +502,7 @@
- enable_nova | bool
- nova_console == 'spice'
- inventory_hostname in groups['haproxy']
- "{{ 'nova_spicehtml5proxy' not in haproxy_stat }}"
- haproxy_stat.find('nova_spicehtml5proxy') == -1
- name: Checking free port for Nova Placement API HAProxy
wait_for:
@ -514,7 +514,7 @@
when:
- enable_nova | bool
- inventory_hostname in groups['haproxy']
- "{{ 'placement_api' not in haproxy_stat }}"
- haproxy_stat.find('placement_api') == -1
- name: Checking free port for Octavia API HAProxy
wait_for:
@ -526,7 +526,7 @@
when:
- enable_octavia | bool
- inventory_hostname in groups['haproxy']
- "{{ 'octavia_api' not in haproxy_stat }}"
- haproxy_stat.find('octavia_api') == -1
- name: Checking free port for Panko API HAProxy
wait_for:
@ -538,7 +538,7 @@
when:
- enable_panko | bool
- inventory_hostname in groups['haproxy']
- "{{ 'panko_api' not in haproxy_stat }}"
- haproxy_stat.find('panko_api') == -1
- name: Checking free port for RabbitMQ Management HAProxy
wait_for:
@ -550,7 +550,7 @@
when:
- enable_rabbitmq | bool
- inventory_hostname in groups['haproxy']
- "{{ 'rabbitmq_management' not in haproxy_stat }}"
- haproxy_stat.find('rabbitmq_management') == -1
- name: Checking free port for RadosGW HAProxy
wait_for:
@ -562,7 +562,7 @@
when:
- enable_ceph_rgw | bool
- inventory_hostname in groups['haproxy']
- "{{ 'radosgw' not in haproxy_stat }}"
- haproxy_stat.find('radosgw') == -1
- name: Checking free port for Sahara API HAProxy
wait_for:
@ -574,7 +574,7 @@
when:
- enable_sahara | bool
- inventory_hostname in groups['haproxy']
- "{{ 'sahara_api' not in haproxy_stat }}"
- haproxy_stat.find('sahara_api') == -1
- name: Checking free port for Searchlight API HAProxy
wait_for:
@ -586,7 +586,7 @@
when:
- enable_searchlight | bool
- inventory_hostname in groups['haproxy']
- "{{ 'searchlight_api' not in haproxy_stat }}"
- haproxy_stat.find('searchlight_api') == -1
- name: Checking free port for Senlin API HAProxy
wait_for:
@ -598,7 +598,7 @@
when:
- enable_senlin | bool
- inventory_hostname in groups['haproxy']
- "{{ 'senlin_api' not in haproxy_stat }}"
- haproxy_stat.find('senlin_api') == -1
- name: Checking free port for Solum Application Deployment HAProxy
wait_for:
@ -610,7 +610,7 @@
when:
- enable_solum | bool
- inventory_hostname in groups['haproxy']
- "{{ 'solum_application_deployment' not in haproxy_stat }}"
- haproxy_stat.find('solum_application_deployment') == -1
- name: Checking free port for Solum Image Builder HAProxy
wait_for:
@ -622,7 +622,7 @@
when:
- enable_solum | bool
- inventory_hostname in groups['haproxy']
- "{{ 'solum_image_builder' not in haproxy_stat }}"
- haproxy_stat.find('solum_image_builder') == -1
- name: Checking free port for Swift Proxy Server HAProxy
wait_for:
@ -634,7 +634,7 @@
when:
- enable_swift | bool
- inventory_hostname in groups['haproxy']
- "{{ 'swift_api' not in haproxy_stat }}"
- haproxy_stat.find('swift_api') == -1
- name: Checking free port for Tacker Server HAProxy
wait_for:
@ -646,7 +646,7 @@
when:
- enable_tacker | bool
- inventory_hostname in groups['haproxy']
- "{{ 'tacker_server' not in haproxy_stat }}"
- haproxy_stat.find('tacker_server') == -1
- name: Checking free port for Trove API HAProxy
wait_for:
@ -658,7 +658,7 @@
when:
- enable_trove | bool
- inventory_hostname in groups['haproxy']
- "{{ 'trove_api' not in haproxy_stat }}"
- haproxy_stat.find('trove_api') == -1
- name: Checking free port for Watcher API HAProxy
wait_for:
@ -670,7 +670,7 @@
when:
- enable_watcher | bool
- inventory_hostname in groups['haproxy']
- "{{ 'watcher_api' not in haproxy_stat }}"
- haproxy_stat.find('watcher_api') == -1
- name: Checking free port for Zun API HAProxy
wait_for:
@ -682,4 +682,4 @@
when:
- enable_zun | bool
- inventory_hostname in groups['haproxy']
- "{{ 'zun_api' not in haproxy_stat }}"
- haproxy_stat.find('zun_api') == -1