From afdd11b9a22ecca70962a4637d89ad50b7ded2e5 Mon Sep 17 00:00:00 2001 From: Bertrand Lallau Date: Tue, 18 Apr 2017 09:10:44 +0200 Subject: [PATCH] Generalize api_interface_address variable usage Useful api_interface_address variable has been define here: https://github.com/openstack/kolla-ansible/blob/master/ansible/group_vars/all.yml#L57 In order to simplify codebase we must use it as much as possible. Change-Id: I18fec19bf69e05a22a4142a9cd1165eccd022455 --- ansible/roles/aodh/tasks/precheck.yml | 2 +- ansible/roles/aodh/templates/aodh.conf.j2 | 2 +- ansible/roles/aodh/templates/wsgi-aodh.conf.j2 | 2 +- ansible/roles/barbican/tasks/precheck.yml | 2 +- .../roles/barbican/templates/barbican-api.ini.j2 | 2 +- ansible/roles/barbican/templates/barbican.conf.j2 | 2 +- ansible/roles/ceilometer/tasks/precheck.yml | 2 +- .../roles/ceilometer/templates/ceilometer.conf.j2 | 2 +- ansible/roles/ceph/tasks/precheck.yml | 2 +- ansible/roles/ceph/templates/ceph.conf.j2 | 2 +- ansible/roles/cinder/tasks/precheck.yml | 2 +- ansible/roles/cloudkitty/tasks/precheck.yml | 2 +- .../roles/cloudkitty/templates/cloudkitty.conf.j2 | 2 +- .../common/templates/conf/input/01-syslog.conf.j2 | 2 +- ansible/roles/congress/tasks/precheck.yml | 2 +- ansible/roles/congress/templates/congress.conf.j2 | 4 ++-- ansible/roles/designate/tasks/precheck.yml | 6 +++--- .../roles/designate/templates/designate.conf.j2 | 2 +- ansible/roles/elasticsearch/tasks/precheck.yml | 2 +- .../elasticsearch/templates/elasticsearch.yml.j2 | 2 +- ansible/roles/etcd/defaults/main.yml | 8 ++++---- ansible/roles/etcd/tasks/precheck.yml | 4 ++-- ansible/roles/freezer/tasks/precheck.yml | 2 +- .../roles/freezer/templates/freezer-api.conf.j2 | 2 +- .../freezer/templates/wsgi-freezer-api.conf.j2 | 2 +- ansible/roles/glance/tasks/precheck.yml | 4 ++-- ansible/roles/gnocchi/tasks/precheck.yml | 2 +- ansible/roles/gnocchi/templates/gnocchi.conf.j2 | 2 +- .../roles/gnocchi/templates/wsgi-gnocchi.conf.j2 | 2 +- ansible/roles/grafana/tasks/precheck.yml | 2 +- ansible/roles/grafana/templates/grafana.ini.j2 | 2 +- ansible/roles/haproxy/templates/haproxy.cfg.j2 | 4 ++-- ansible/roles/heat/tasks/precheck.yml | 4 ++-- ansible/roles/horizon/tasks/precheck.yml | 2 +- ansible/roles/influxdb/tasks/precheck.yml | 4 ++-- ansible/roles/ironic/tasks/precheck.yml | 4 ++-- ansible/roles/ironic/templates/ironic.conf.j2 | 2 +- ansible/roles/iscsi/tasks/precheck.yml | 2 +- ansible/roles/karbor/tasks/precheck.yml | 2 +- ansible/roles/karbor/templates/karbor.conf.j2 | 2 +- ansible/roles/keystone/tasks/precheck.yml | 6 +++--- ansible/roles/keystone/templates/sshd_config.j2 | 2 +- ansible/roles/kibana/templates/kibana.yml.j2 | 2 +- ansible/roles/kuryr/tasks/precheck.yml | 2 +- ansible/roles/kuryr/templates/kuryr.conf.j2 | 2 +- ansible/roles/kuryr/templates/kuryr.spec.j2 | 2 +- ansible/roles/magnum/tasks/precheck.yml | 2 +- ansible/roles/magnum/templates/magnum.conf.j2 | 4 ++-- ansible/roles/manila/tasks/precheck.yml | 2 +- ansible/roles/manila/templates/manila.conf.j2 | 4 ++-- ansible/roles/mariadb/tasks/precheck.yml | 8 ++++---- ansible/roles/mariadb/tasks/register.yml | 2 +- ansible/roles/mariadb/tasks/start.yml | 2 +- ansible/roles/memcached/tasks/precheck.yml | 2 +- ansible/roles/mistral/tasks/precheck.yml | 2 +- ansible/roles/mistral/templates/mistral.conf.j2 | 2 +- ansible/roles/mongodb/tasks/bootstrap_cluster.yml | 2 +- ansible/roles/mongodb/tasks/precheck.yml | 4 ++-- ansible/roles/mongodb/tasks/start.yml | 4 ++-- ansible/roles/mongodb/templates/mongodb.conf.j2 | 2 +- ansible/roles/murano/tasks/precheck.yml | 2 +- ansible/roles/murano/templates/murano.conf.j2 | 2 +- ansible/roles/neutron/tasks/precheck.yml | 2 +- ansible/roles/nova/tasks/precheck.yml | 14 +++++++------- ansible/roles/nova/templates/nova.conf.j2 | 4 ++-- ansible/roles/octavia/tasks/precheck.yml | 4 ++-- ansible/roles/octavia/templates/octavia.conf.j2 | 6 +++--- ansible/roles/openvswitch/tasks/precheck.yml | 2 +- ansible/roles/panko/tasks/precheck.yml | 2 +- ansible/roles/panko/templates/wsgi-panko.conf.j2 | 2 +- ansible/roles/prechecks/tasks/port_checks.yml | 2 +- ansible/roles/rabbitmq/tasks/precheck.yml | 8 ++++---- ansible/roles/sahara/tasks/precheck.yml | 2 +- ansible/roles/sahara/templates/sahara.conf.j2 | 2 +- ansible/roles/searchlight/tasks/precheck.yml | 2 +- .../searchlight/templates/searchlight.conf.j2 | 2 +- ansible/roles/senlin/tasks/precheck.yml | 2 +- ansible/roles/solum/tasks/precheck.yml | 4 ++-- ansible/roles/solum/templates/solum.conf.j2 | 2 +- ansible/roles/swift/tasks/precheck.yml | 2 +- ansible/roles/swift/templates/account.conf.j2 | 2 +- ansible/roles/swift/templates/container.conf.j2 | 2 +- ansible/roles/swift/templates/object.conf.j2 | 2 +- ansible/roles/swift/templates/proxy-server.conf.j2 | 4 ++-- ansible/roles/swift/templates/rsyncd.conf.j2 | 2 +- ansible/roles/tacker/tasks/precheck.yml | 2 +- ansible/roles/telegraf/templates/telegraf.conf.j2 | 8 ++++---- ansible/roles/trove/tasks/precheck.yml | 2 +- ansible/roles/trove/templates/trove.conf.j2 | 4 ++-- ansible/roles/watcher/tasks/precheck.yml | 2 +- ansible/roles/watcher/templates/watcher.conf.j2 | 2 +- ansible/roles/zun/tasks/precheck.yml | 2 +- ansible/roles/zun/templates/zun.conf.j2 | 2 +- 93 files changed, 133 insertions(+), 133 deletions(-) diff --git a/ansible/roles/aodh/tasks/precheck.yml b/ansible/roles/aodh/tasks/precheck.yml index b9389d525e..07f5b4e532 100644 --- a/ansible/roles/aodh/tasks/precheck.yml +++ b/ansible/roles/aodh/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Aodh API wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ aodh_api_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/aodh/templates/aodh.conf.j2 b/ansible/roles/aodh/templates/aodh.conf.j2 index 0295a44afb..f93d717afd 100644 --- a/ansible/roles/aodh/templates/aodh.conf.j2 +++ b/ansible/roles/aodh/templates/aodh.conf.j2 @@ -9,7 +9,7 @@ transport_url = rabbit://{% for host in groups['rabbitmq'] %}{{ rabbitmq_user }} [api] port = {{ aodh_api_port }} -host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +host = {{ api_interface_address }} [database] connection = mysql+pymysql://{{ aodh_database_user }}:{{ aodh_database_password }}@{{ aodh_database_address }}/{{ aodh_database_name }} diff --git a/ansible/roles/aodh/templates/wsgi-aodh.conf.j2 b/ansible/roles/aodh/templates/wsgi-aodh.conf.j2 index e09266198f..8a28104009 100644 --- a/ansible/roles/aodh/templates/wsgi-aodh.conf.j2 +++ b/ansible/roles/aodh/templates/wsgi-aodh.conf.j2 @@ -1,5 +1,5 @@ {% set python_path = '/usr/lib/python2.7/site-packages' if kolla_install_type == 'binary' else '/var/lib/kolla/venv/lib/python2.7/site-packages' %} -Listen {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ aodh_api_port }} +Listen {{ api_interface_address }}:{{ aodh_api_port }} diff --git a/ansible/roles/barbican/tasks/precheck.yml b/ansible/roles/barbican/tasks/precheck.yml index 11a349eada..3b798e2052 100644 --- a/ansible/roles/barbican/tasks/precheck.yml +++ b/ansible/roles/barbican/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Barbican API wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ barbican_api_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/barbican/templates/barbican-api.ini.j2 b/ansible/roles/barbican/templates/barbican-api.ini.j2 index 3e1fc65bb6..9fa7d13bbc 100644 --- a/ansible/roles/barbican/templates/barbican-api.ini.j2 +++ b/ansible/roles/barbican/templates/barbican-api.ini.j2 @@ -1,5 +1,5 @@ [uwsgi] -socket = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ barbican_api_port }} +socket = {{ api_interface_address }}:{{ barbican_api_port }} protocol = http processes = {{ openstack_service_workers }} lazy = true diff --git a/ansible/roles/barbican/templates/barbican.conf.j2 b/ansible/roles/barbican/templates/barbican.conf.j2 index a5616a560b..b0211174d3 100644 --- a/ansible/roles/barbican/templates/barbican.conf.j2 +++ b/ansible/roles/barbican/templates/barbican.conf.j2 @@ -3,7 +3,7 @@ debug = {{ barbican_logging_debug }} log_dir = /var/log/kolla/barbican bind_port = {{ barbican_api_port }} -bind_host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +bind_host = {{ api_interface_address }} host_href = {{ public_protocol }}://{{ kolla_external_fqdn }}:{{ barbican_api_port }} backlog = 4096 max_allowed_secret_in_bytes = 10000 diff --git a/ansible/roles/ceilometer/tasks/precheck.yml b/ansible/roles/ceilometer/tasks/precheck.yml index a7643161e4..28b64bdbbb 100644 --- a/ansible/roles/ceilometer/tasks/precheck.yml +++ b/ansible/roles/ceilometer/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Ceilometer API wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ ceilometer_api_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/ceilometer/templates/ceilometer.conf.j2 b/ansible/roles/ceilometer/templates/ceilometer.conf.j2 index 927154bca5..db1976cc24 100644 --- a/ansible/roles/ceilometer/templates/ceilometer.conf.j2 +++ b/ansible/roles/ceilometer/templates/ceilometer.conf.j2 @@ -21,7 +21,7 @@ meter_dispatchers = database [api] port = {{ ceilometer_api_port }} -host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +host = {{ api_interface_address }} [collector] diff --git a/ansible/roles/ceph/tasks/precheck.yml b/ansible/roles/ceph/tasks/precheck.yml index aca5425f15..8141c61e45 100644 --- a/ansible/roles/ceph/tasks/precheck.yml +++ b/ansible/roles/ceph/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for RadosGW wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ rgw_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/ceph/templates/ceph.conf.j2 b/ansible/roles/ceph/templates/ceph.conf.j2 index d355f6c09e..af87282d0a 100644 --- a/ansible/roles/ceph/templates/ceph.conf.j2 +++ b/ansible/roles/ceph/templates/ceph.conf.j2 @@ -34,7 +34,7 @@ mon cluster log file = /var/log/kolla/ceph/$cluster.log [client.radosgw.gateway] {% if orchestration_engine != 'KUBERNETES' %} host = {{ hostvars[inventory_hostname]['ansible_' + storage_interface]['ipv4']['address'] }} -rgw frontends = civetweb port={{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ rgw_port }} +rgw frontends = civetweb port={{ api_interface_address }}:{{ rgw_port }} {% endif %} {% if enable_ceph_rgw_keystone | bool %} rgw_keystone_url = {{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_admin_port }} diff --git a/ansible/roles/cinder/tasks/precheck.yml b/ansible/roles/cinder/tasks/precheck.yml index c028597daf..bb0dbf350d 100644 --- a/ansible/roles/cinder/tasks/precheck.yml +++ b/ansible/roles/cinder/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Cinder API wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ cinder_api_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/cloudkitty/tasks/precheck.yml b/ansible/roles/cloudkitty/tasks/precheck.yml index e4f1ba96ec..bf61bfefb9 100644 --- a/ansible/roles/cloudkitty/tasks/precheck.yml +++ b/ansible/roles/cloudkitty/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Cloudkitty API wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ cloudkitty_api_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/cloudkitty/templates/cloudkitty.conf.j2 b/ansible/roles/cloudkitty/templates/cloudkitty.conf.j2 index 9ac91dcd6c..23861f0271 100644 --- a/ansible/roles/cloudkitty/templates/cloudkitty.conf.j2 +++ b/ansible/roles/cloudkitty/templates/cloudkitty.conf.j2 @@ -47,7 +47,7 @@ auth_section = keystone_authtoken {% endif %} [api] -host_ip = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +host_ip = {{ api_interface_address }} port = {{ cloudkitty_api_port }} [orchestrator] diff --git a/ansible/roles/common/templates/conf/input/01-syslog.conf.j2 b/ansible/roles/common/templates/conf/input/01-syslog.conf.j2 index 41dc7de644..249b57e91b 100644 --- a/ansible/roles/common/templates/conf/input/01-syslog.conf.j2 +++ b/ansible/roles/common/templates/conf/input/01-syslog.conf.j2 @@ -2,7 +2,7 @@ @type syslog port {{ fluentd_syslog_port }} {% if orchestration_engine != 'KUBERNETES' %} - bind {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} + bind {{ api_interface_address }} {% else %} bind 0.0.0.0 {% endif %} diff --git a/ansible/roles/congress/tasks/precheck.yml b/ansible/roles/congress/tasks/precheck.yml index 307b1019d0..d98647364b 100644 --- a/ansible/roles/congress/tasks/precheck.yml +++ b/ansible/roles/congress/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Congress API wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ congress_api_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/congress/templates/congress.conf.j2 b/ansible/roles/congress/templates/congress.conf.j2 index 586121c9bc..c5b3734167 100644 --- a/ansible/roles/congress/templates/congress.conf.j2 +++ b/ansible/roles/congress/templates/congress.conf.j2 @@ -13,12 +13,12 @@ os_region_name = {{ openstack_region_name }} # stderr and collected by Docker use_stderr = False -my_ip = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +my_ip = {{ api_interface_address }} api_paste_config = /etc/congress/api-paste.ini {% if service_name == 'congress-api' %} -bind_host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +bind_host = {{ api_interface_address }} bind_port = {{ congress_api_port }} {% endif %} diff --git a/ansible/roles/designate/tasks/precheck.yml b/ansible/roles/designate/tasks/precheck.yml index d94d07bf17..8f9c54ff2a 100644 --- a/ansible/roles/designate/tasks/precheck.yml +++ b/ansible/roles/designate/tasks/precheck.yml @@ -9,7 +9,7 @@ - name: Checking free port for designate API wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ designate_api_port }}" connect_timeout: 1 timeout: 1 @@ -31,7 +31,7 @@ - name: Checking free port for designate backend bind9 port wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ designate_bind_port }}" connect_timeout: 1 timeout: 1 @@ -43,7 +43,7 @@ - name: Checking free port for designate backend rndc port wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ designate_rndc_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/designate/templates/designate.conf.j2 b/ansible/roles/designate/templates/designate.conf.j2 index 9775a2c019..02532a2cf3 100644 --- a/ansible/roles/designate/templates/designate.conf.j2 +++ b/ansible/roles/designate/templates/designate.conf.j2 @@ -12,7 +12,7 @@ workers = {{ openstack_service_workers }} [service:api] api_base_uri = {{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ designate_api_port }} -api_host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +api_host = {{ api_interface_address }} api_port = {{ designate_api_port }} enable_api_v1 = True enabled_extensions_v1 = 'diagnostics, quotas, reports, sync, touch' diff --git a/ansible/roles/elasticsearch/tasks/precheck.yml b/ansible/roles/elasticsearch/tasks/precheck.yml index 0543a7451f..409c765d28 100644 --- a/ansible/roles/elasticsearch/tasks/precheck.yml +++ b/ansible/roles/elasticsearch/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Elasticsearch wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ elasticsearch_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/elasticsearch/templates/elasticsearch.yml.j2 b/ansible/roles/elasticsearch/templates/elasticsearch.yml.j2 index 14f1bc4711..9cc7d80437 100644 --- a/ansible/roles/elasticsearch/templates/elasticsearch.yml.j2 +++ b/ansible/roles/elasticsearch/templates/elasticsearch.yml.j2 @@ -1,7 +1,7 @@ {% set num_nodes = groups['elasticsearch'] | length %} {% set minimum_master_nodes = (num_nodes / 2 + 1) | round(0, 'floor') | int if num_nodes > 2 else 1 %} {% set recover_after_nodes = (num_nodes * 2 / 3) | round(0, 'floor') | int if num_nodes > 1 else 1 %} -node.name: "{% if orchestration_engine == 'KUBERNETES' %}0.0.0.0{% else %}{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}{% endif %}" +node.name: "{{ api_interface_address }}" network.host: {% if orchestration_engine == 'KUBERNETES' %}_eth0:ipv4_{% else %}"{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"{% endif %} cluster.name: "{% if orchestration_engine == 'KUBERNETES' %}0.0.0.0{% else %}{{ elasticsearch_cluster_name }}{% endif %}" diff --git a/ansible/roles/etcd/defaults/main.yml b/ansible/roles/etcd/defaults/main.yml index 9d9902f905..44c51bbcdf 100644 --- a/ansible/roles/etcd/defaults/main.yml +++ b/ansible/roles/etcd/defaults/main.yml @@ -9,10 +9,10 @@ etcd_services: environment: ETCD_DATA_DIR: "/var/lib/etcd" ETCD_NAME: "{{ ansible_hostname }}" - ETCD_ADVERTISE_CLIENT_URLS: "{{ internal_protocol }}://{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ etcd_client_port }}" - ETCD_LISTEN_CLIENT_URLS: "{{ internal_protocol }}://{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ etcd_client_port }}" - ETCD_INITIAL_ADVERTISE_PEER_URLS: "{{ internal_protocol }}://{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ etcd_peer_port }}" - ETCD_LISTEN_PEER_URLS: "{{ internal_protocol }}://{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ etcd_peer_port }}" + ETCD_ADVERTISE_CLIENT_URLS: "{{ internal_protocol }}://{{ api_interface_address }}:{{ etcd_client_port }}" + ETCD_LISTEN_CLIENT_URLS: "{{ internal_protocol }}://{{ api_interface_address }}:{{ etcd_client_port }}" + ETCD_INITIAL_ADVERTISE_PEER_URLS: "{{ internal_protocol }}://{{ api_interface_address }}:{{ etcd_peer_port }}" + ETCD_LISTEN_PEER_URLS: "{{ internal_protocol }}://{{ api_interface_address }}:{{ etcd_peer_port }}" ETCD_INITIAL_CLUSTER_TOKEN: "{{ etcd_cluster_token }}" ETCD_INITIAL_CLUSTER: "{% for host in groups['etcd'] %}{{ hostvars[host]['ansible_hostname'] }}={{ internal_protocol }}://{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ etcd_peer_port }}{% if not loop.last %},{% endif %}{% endfor %}" ETCD_INITIAL_CLUSTER_STATE: "new" diff --git a/ansible/roles/etcd/tasks/precheck.yml b/ansible/roles/etcd/tasks/precheck.yml index ddfe8fe0bb..8ac30f11bc 100644 --- a/ansible/roles/etcd/tasks/precheck.yml +++ b/ansible/roles/etcd/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Etcd Peer wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ etcd_peer_port }}" connect_timeout: 1 timeout: 1 @@ -18,7 +18,7 @@ - name: Checking free port for Etcd Client wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ etcd_client_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/freezer/tasks/precheck.yml b/ansible/roles/freezer/tasks/precheck.yml index 7f47a474ac..82d50b02e0 100644 --- a/ansible/roles/freezer/tasks/precheck.yml +++ b/ansible/roles/freezer/tasks/precheck.yml @@ -6,7 +6,7 @@ - name: Checking free port for Freezer API wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ freezer_api_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/freezer/templates/freezer-api.conf.j2 b/ansible/roles/freezer/templates/freezer-api.conf.j2 index 7b96c2df67..2d2cf122c6 100644 --- a/ansible/roles/freezer/templates/freezer-api.conf.j2 +++ b/ansible/roles/freezer/templates/freezer-api.conf.j2 @@ -4,7 +4,7 @@ debug = {{ freezer_logging_debug }} log_dir = /var/log/kolla/freezer {% if service_name == 'freezer-api' %} -bind_host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +bind_host = {{ api_interface_address }} bind_port = {{ freezer_api_port }} {% endif %} diff --git a/ansible/roles/freezer/templates/wsgi-freezer-api.conf.j2 b/ansible/roles/freezer/templates/wsgi-freezer-api.conf.j2 index 35ba3b9448..cfcf37c3c9 100644 --- a/ansible/roles/freezer/templates/wsgi-freezer-api.conf.j2 +++ b/ansible/roles/freezer/templates/wsgi-freezer-api.conf.j2 @@ -1,6 +1,6 @@ {% set freezer_log_dir = '/var/log/kolla/freezer' %} {% set python_path = '/usr/lib/python2.7/site-packages' if kolla_install_type == 'binary' else '/var/lib/kolla/venv/lib/python2.7/site-packages' %} -Listen {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ freezer_api_port }} +Listen {{ api_interface_address }}:{{ freezer_api_port }} WSGIDaemonProcess freezer-api processes={{ openstack_service_workers }} threads=1 user=freezer display-name=%{GROUP} diff --git a/ansible/roles/glance/tasks/precheck.yml b/ansible/roles/glance/tasks/precheck.yml index 5566e0c528..b030bcd156 100644 --- a/ansible/roles/glance/tasks/precheck.yml +++ b/ansible/roles/glance/tasks/precheck.yml @@ -6,7 +6,7 @@ - name: Checking free port for Glance API wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ glance_api_port }}" connect_timeout: 1 timeout: 1 @@ -17,7 +17,7 @@ - name: Checking free port for Glance Registry wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ glance_registry_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/gnocchi/tasks/precheck.yml b/ansible/roles/gnocchi/tasks/precheck.yml index 4fe224aca6..001953e431 100644 --- a/ansible/roles/gnocchi/tasks/precheck.yml +++ b/ansible/roles/gnocchi/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Gnocchi API wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ gnocchi_api_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/gnocchi/templates/gnocchi.conf.j2 b/ansible/roles/gnocchi/templates/gnocchi.conf.j2 index 10aea84ca4..0910123fcb 100644 --- a/ansible/roles/gnocchi/templates/gnocchi.conf.j2 +++ b/ansible/roles/gnocchi/templates/gnocchi.conf.j2 @@ -6,7 +6,7 @@ log_dir = /var/log/kolla/gnocchi [api] port = {{ gnocchi_api_port }} -host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +host = {{ api_interface_address }} middlewares = keystonemiddleware.auth_token.AuthProtocol auth_mode = keystone diff --git a/ansible/roles/gnocchi/templates/wsgi-gnocchi.conf.j2 b/ansible/roles/gnocchi/templates/wsgi-gnocchi.conf.j2 index 3257eb237e..59ae05c7f3 100644 --- a/ansible/roles/gnocchi/templates/wsgi-gnocchi.conf.j2 +++ b/ansible/roles/gnocchi/templates/wsgi-gnocchi.conf.j2 @@ -1,5 +1,5 @@ {% set python_path = '/usr/lib/python2.7/site-packages' if kolla_install_type == 'binary' else '/var/lib/kolla/venv/lib/python2.7/site-packages' %} -Listen {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ gnocchi_api_port }} +Listen {{ api_interface_address }}:{{ gnocchi_api_port }} diff --git a/ansible/roles/grafana/tasks/precheck.yml b/ansible/roles/grafana/tasks/precheck.yml index 81df811cf5..2545a37d35 100644 --- a/ansible/roles/grafana/tasks/precheck.yml +++ b/ansible/roles/grafana/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Grafana server wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ grafana_server_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/grafana/templates/grafana.ini.j2 b/ansible/roles/grafana/templates/grafana.ini.j2 index fc6ab5976f..f4a4100cc0 100644 --- a/ansible/roles/grafana/templates/grafana.ini.j2 +++ b/ansible/roles/grafana/templates/grafana.ini.j2 @@ -5,7 +5,7 @@ plugins = /var/lib/grafana/plugins [server] protocol = http -http_addr = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +http_addr = {{ api_interface_address }} http_port = {{ grafana_server_port }} router_logging = true diff --git a/ansible/roles/haproxy/templates/haproxy.cfg.j2 b/ansible/roles/haproxy/templates/haproxy.cfg.j2 index 54256baaf3..f3aeff0a60 100644 --- a/ansible/roles/haproxy/templates/haproxy.cfg.j2 +++ b/ansible/roles/haproxy/templates/haproxy.cfg.j2 @@ -5,7 +5,7 @@ global group haproxy daemon {% if orchestration_engine != 'KUBERNETES' %} - log {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ fluentd_syslog_port }} local1 + log {{ api_interface_address }}:{{ fluentd_syslog_port }} local1 {% endif %} maxconn 4000 stats socket /var/lib/kolla/haproxy/haproxy.sock @@ -30,7 +30,7 @@ defaults timeout check 10s listen stats - bind {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ haproxy_stats_port }} + bind {{ api_interface_address }}:{{ haproxy_stats_port }} mode http stats enable stats uri / diff --git a/ansible/roles/heat/tasks/precheck.yml b/ansible/roles/heat/tasks/precheck.yml index d061133362..6c29daaa0e 100644 --- a/ansible/roles/heat/tasks/precheck.yml +++ b/ansible/roles/heat/tasks/precheck.yml @@ -8,7 +8,7 @@ - name: Checking free port for Heat API wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ heat_api_port }}" connect_timeout: 1 timeout: 1 @@ -19,7 +19,7 @@ - name: Checking free port for Heat API CFN wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ heat_api_cfn_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/horizon/tasks/precheck.yml b/ansible/roles/horizon/tasks/precheck.yml index 8b1a561e8f..43855f8886 100644 --- a/ansible/roles/horizon/tasks/precheck.yml +++ b/ansible/roles/horizon/tasks/precheck.yml @@ -9,7 +9,7 @@ vars: horizon: "{{ horizon_services['horizon'] }}" wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ horizon_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/influxdb/tasks/precheck.yml b/ansible/roles/influxdb/tasks/precheck.yml index a67845bda0..c7a839daac 100644 --- a/ansible/roles/influxdb/tasks/precheck.yml +++ b/ansible/roles/influxdb/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Influxdb Admin wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ influxdb_admin_port }}" connect_timeout: 1 timeout: 1 @@ -18,7 +18,7 @@ - name: Checking free port for Influxdb Http wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ influxdb_http_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/ironic/tasks/precheck.yml b/ansible/roles/ironic/tasks/precheck.yml index 9b58bbc396..2bf0a4a664 100644 --- a/ansible/roles/ironic/tasks/precheck.yml +++ b/ansible/roles/ironic/tasks/precheck.yml @@ -8,7 +8,7 @@ - name: Checking free port for Ironic API wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ ironic_api_port }}" connect_timeout: 1 timeout: 1 @@ -19,7 +19,7 @@ - name: Checking free port for Ironic Inspector wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ ironic_inspector_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/ironic/templates/ironic.conf.j2 b/ansible/roles/ironic/templates/ironic.conf.j2 index 80ec5f81ec..9673693a98 100644 --- a/ansible/roles/ironic/templates/ironic.conf.j2 +++ b/ansible/roles/ironic/templates/ironic.conf.j2 @@ -14,7 +14,7 @@ transport_url = rabbit://{% for host in groups['rabbitmq'] %}{{ rabbitmq_user }} [api] {% if orchestration_engine != 'KUBERNETES' %} -host_ip = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +host_ip = {{ api_interface_address }} {% else %} host_ip = 0.0.0.0 {% endif %} diff --git a/ansible/roles/iscsi/tasks/precheck.yml b/ansible/roles/iscsi/tasks/precheck.yml index 64a99de4ef..b0c24d2ecb 100644 --- a/ansible/roles/iscsi/tasks/precheck.yml +++ b/ansible/roles/iscsi/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for iscsi wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ iscsi_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/karbor/tasks/precheck.yml b/ansible/roles/karbor/tasks/precheck.yml index cf176fc85c..2dff30b47d 100644 --- a/ansible/roles/karbor/tasks/precheck.yml +++ b/ansible/roles/karbor/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Karbor Admin wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ karbor_api_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/karbor/templates/karbor.conf.j2 b/ansible/roles/karbor/templates/karbor.conf.j2 index 26d5be797d..d9d86133b9 100644 --- a/ansible/roles/karbor/templates/karbor.conf.j2 +++ b/ansible/roles/karbor/templates/karbor.conf.j2 @@ -4,7 +4,7 @@ log_dir = /var/log/kolla/karbor transport_url = rabbit://{% for host in groups['rabbitmq'] %}{{ rabbitmq_user }}:{{ rabbitmq_password }}@{% if orchestration_engine == 'KUBERNETES' %}rabbitmq{% else %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}{% endif %}:{{ rabbitmq_port }}{% if not loop.last %},{% endif %}{% endfor %} {% if service_name == 'karbor-api' %} -osapi_karbor_listen = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +osapi_karbor_listen = {{ api_interface_address }} osapi_karbor_listen_port = {{ karbor_api_port }} osapi_karbor_workers = {{ openstack_service_workers }} {% endif %} diff --git a/ansible/roles/keystone/tasks/precheck.yml b/ansible/roles/keystone/tasks/precheck.yml index 99ea5d2a3d..3df21a2d4e 100644 --- a/ansible/roles/keystone/tasks/precheck.yml +++ b/ansible/roles/keystone/tasks/precheck.yml @@ -8,7 +8,7 @@ - name: Checking free port for Keystone Admin wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ keystone_admin_port }}" connect_timeout: 1 timeout: 1 @@ -19,7 +19,7 @@ - name: Checking free port for Keystone Public wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ keystone_public_port }}" connect_timeout: 1 timeout: 1 @@ -32,7 +32,7 @@ vars: keystone_ssh: "{{ keystone_services['keystone-ssh'] }}" wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ keystone_ssh_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/keystone/templates/sshd_config.j2 b/ansible/roles/keystone/templates/sshd_config.j2 index 8b66f42c7d..3dc8470a0f 100644 --- a/ansible/roles/keystone/templates/sshd_config.j2 +++ b/ansible/roles/keystone/templates/sshd_config.j2 @@ -1,5 +1,5 @@ Port {{ keystone_ssh_port }} -ListenAddress {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +ListenAddress {{ api_interface_address }} SyslogFacility AUTHPRIV UsePAM yes diff --git a/ansible/roles/kibana/templates/kibana.yml.j2 b/ansible/roles/kibana/templates/kibana.yml.j2 index 9d161b0fbe..fbdcdcc98a 100644 --- a/ansible/roles/kibana/templates/kibana.yml.j2 +++ b/ansible/roles/kibana/templates/kibana.yml.j2 @@ -1,7 +1,7 @@ kibana.defaultAppId: "{{ kibana_default_app_id }}" logging.dest: /var/log/kolla/kibana/kibana.log server.port: {{ kibana_server_port }} -server.host: "{% if orchestration_engine == 'KUBERNETES' %}0.0.0.0{% else %}{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}{% endif %}" +server.host: "{{ api_interface_address }}" elasticsearch.url: "{{ internal_protocol }}://{% if orchestration_engine == 'KUBERNETES' %}elasticsearch{% else %}{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}{% endif %}:{{ elasticsearch_port }}" elasticsearch.requestTimeout: {{ kibana_elasticsearch_request_timeout }} elasticsearch.shardTimeout: {{ kibana_elasticsearch_shard_timeout }} diff --git a/ansible/roles/kuryr/tasks/precheck.yml b/ansible/roles/kuryr/tasks/precheck.yml index 877c32db55..35f26c5495 100644 --- a/ansible/roles/kuryr/tasks/precheck.yml +++ b/ansible/roles/kuryr/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Kuryr wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ kuryr_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/kuryr/templates/kuryr.conf.j2 b/ansible/roles/kuryr/templates/kuryr.conf.j2 index 22b6199077..4cd7924848 100644 --- a/ansible/roles/kuryr/templates/kuryr.conf.j2 +++ b/ansible/roles/kuryr/templates/kuryr.conf.j2 @@ -1,5 +1,5 @@ [DEFAULT] -kuryr_uri = http://{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ kuryr_port }} +kuryr_uri = http://{{ api_interface_address }}:{{ kuryr_port }} debug = {{ kuryr_logging_debug }} [binding] diff --git a/ansible/roles/kuryr/templates/kuryr.spec.j2 b/ansible/roles/kuryr/templates/kuryr.spec.j2 index 8d513bfb7c..e9a7ada93a 100644 --- a/ansible/roles/kuryr/templates/kuryr.spec.j2 +++ b/ansible/roles/kuryr/templates/kuryr.spec.j2 @@ -1 +1 @@ -http://{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ kuryr_port }} +http://{{ api_interface_address }}:{{ kuryr_port }} diff --git a/ansible/roles/magnum/tasks/precheck.yml b/ansible/roles/magnum/tasks/precheck.yml index d4814cbaa1..ef115c89ec 100644 --- a/ansible/roles/magnum/tasks/precheck.yml +++ b/ansible/roles/magnum/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Magnum API wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ magnum_api_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/magnum/templates/magnum.conf.j2 b/ansible/roles/magnum/templates/magnum.conf.j2 index a2d9aed0b9..32d8c53ed6 100644 --- a/ansible/roles/magnum/templates/magnum.conf.j2 +++ b/ansible/roles/magnum/templates/magnum.conf.j2 @@ -3,14 +3,14 @@ debug = {{ magnum_logging_debug }} state_path = /var/lib/magnum log_dir = /var/log/kolla/magnum -host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +host = {{ api_interface_address }} transport_url = rabbit://{% for host in groups['rabbitmq'] %}{{ rabbitmq_user }}:{{ rabbitmq_password }}@{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ rabbitmq_port }}{% if not loop.last %},{% endif %}{% endfor %} {% if service_name == 'magnum-api' %} [api] port = {{ magnum_api_port }} -host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +host = {{ api_interface_address }} workers = {{ openstack_service_workers }} {% endif %} diff --git a/ansible/roles/manila/tasks/precheck.yml b/ansible/roles/manila/tasks/precheck.yml index 96999cbc52..87e6d95b0d 100644 --- a/ansible/roles/manila/tasks/precheck.yml +++ b/ansible/roles/manila/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Manila API wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ manila_api_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/manila/templates/manila.conf.j2 b/ansible/roles/manila/templates/manila.conf.j2 index af31281e4e..fa79fe4929 100644 --- a/ansible/roles/manila/templates/manila.conf.j2 +++ b/ansible/roles/manila/templates/manila.conf.j2 @@ -4,9 +4,9 @@ debug = {{ manila_logging_debug }} log_dir = /var/log/kolla/manila use_forwarded_for = true -my_ip = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +my_ip = {{ api_interface_address }} -osapi_share_listen = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +osapi_share_listen = {{ api_interface_address }} osapi_share_listen_port = {{ manila_api_port }} osapi_share_workers = {{ openstack_service_workers }} diff --git a/ansible/roles/mariadb/tasks/precheck.yml b/ansible/roles/mariadb/tasks/precheck.yml index f21e9c06b8..0f9fa175b1 100644 --- a/ansible/roles/mariadb/tasks/precheck.yml +++ b/ansible/roles/mariadb/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for MariaDB wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ database_port }}" connect_timeout: 1 timeout: 1 @@ -17,7 +17,7 @@ - name: Checking free port for MariaDB WSREP wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ mariadb_wsrep_port }}" connect_timeout: 1 timeout: 1 @@ -27,7 +27,7 @@ - name: Checking free port for MariaDB IST wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ mariadb_ist_port }}" connect_timeout: 1 timeout: 1 @@ -37,7 +37,7 @@ - name: Checking free port for MariaDB SST wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ mariadb_sst_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/mariadb/tasks/register.yml b/ansible/roles/mariadb/tasks/register.yml index 0a23518047..76030f2b46 100644 --- a/ansible/roles/mariadb/tasks/register.yml +++ b/ansible/roles/mariadb/tasks/register.yml @@ -3,7 +3,7 @@ kolla_toolbox: module_name: mysql_user module_args: - login_host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + login_host: "{{ api_interface_address }}" login_port: "{{ mariadb_port }}" login_user: "{{ database_user }}" login_password: "{{ database_password }}" diff --git a/ansible/roles/mariadb/tasks/start.yml b/ansible/roles/mariadb/tasks/start.yml index f71ad37a52..bec5f29ba7 100644 --- a/ansible/roles/mariadb/tasks/start.yml +++ b/ansible/roles/mariadb/tasks/start.yml @@ -20,7 +20,7 @@ # https://github.com/ansible/ansible-modules-core/issues/2788 - name: Waiting for MariaDB service to be ready wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ mariadb_port }}" connect_timeout: 1 timeout: 60 diff --git a/ansible/roles/memcached/tasks/precheck.yml b/ansible/roles/memcached/tasks/precheck.yml index 138c4cb540..e9941fee6b 100644 --- a/ansible/roles/memcached/tasks/precheck.yml +++ b/ansible/roles/memcached/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Memcached wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ memcached_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/mistral/tasks/precheck.yml b/ansible/roles/mistral/tasks/precheck.yml index cdae9bec3a..d80d79af41 100644 --- a/ansible/roles/mistral/tasks/precheck.yml +++ b/ansible/roles/mistral/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Mistral API wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ mistral_api_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/mistral/templates/mistral.conf.j2 b/ansible/roles/mistral/templates/mistral.conf.j2 index 76080d50f3..812efdd390 100644 --- a/ansible/roles/mistral/templates/mistral.conf.j2 +++ b/ansible/roles/mistral/templates/mistral.conf.j2 @@ -11,7 +11,7 @@ transport_url = rabbit://{% for host in groups['rabbitmq'] %}{{ rabbitmq_user }} {% if service_name == 'mistral-api' %} [api] -host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +host = {{ api_interface_address }} port = {{ mistral_api_port }} api_workers = {{ openstack_service_workers }} {% endif %} diff --git a/ansible/roles/mongodb/tasks/bootstrap_cluster.yml b/ansible/roles/mongodb/tasks/bootstrap_cluster.yml index 31068f8b97..d1d7f66dfd 100644 --- a/ansible/roles/mongodb/tasks/bootstrap_cluster.yml +++ b/ansible/roles/mongodb/tasks/bootstrap_cluster.yml @@ -4,7 +4,7 @@ run_once: True - name: Bootstraping the mongodb replication set - command: "docker exec -t mongodb mongo {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} --quiet --eval '{{ lookup('file','/tmp/mongodb_bootstrap_replication_set.js') }}'" + command: "docker exec -t mongodb mongo {{ api_interface_address }} --quiet --eval '{{ lookup('file','/tmp/mongodb_bootstrap_replication_set.js') }}'" register: bootstrap_mongodb_cluster failed_when: "{{ (bootstrap_mongodb_cluster.stdout|from_json).ok != 1 }}" delegate_to: "{{ groups['mongodb'][0] }}" diff --git a/ansible/roles/mongodb/tasks/precheck.yml b/ansible/roles/mongodb/tasks/precheck.yml index d09e5825a2..316e3c5635 100644 --- a/ansible/roles/mongodb/tasks/precheck.yml +++ b/ansible/roles/mongodb/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Mongodb wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ mongodb_port }}" connect_timeout: 1 timeout: 1 @@ -18,7 +18,7 @@ - name: Checking free port for Mongodb Web wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ mongodb_web_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/mongodb/tasks/start.yml b/ansible/roles/mongodb/tasks/start.yml index 3926a73168..89ad7570f9 100644 --- a/ansible/roles/mongodb/tasks/start.yml +++ b/ansible/roles/mongodb/tasks/start.yml @@ -13,10 +13,10 @@ - "mongodb:/var/lib/mongodb" - name: Waiting for the mongodb startup - wait_for: host={{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} port={{ mongodb_port }} + wait_for: host={{ api_interface_address }} port={{ mongodb_port }} - name: Checking current replication status - command: "docker exec -t mongodb mongo {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} --quiet --eval rs.status().ok" + command: "docker exec -t mongodb mongo {{ api_interface_address }} --quiet --eval rs.status().ok" register: mongodb_replication_status changed_when: false delegate_to: "{{ groups['mongodb'][0] }}" diff --git a/ansible/roles/mongodb/templates/mongodb.conf.j2 b/ansible/roles/mongodb/templates/mongodb.conf.j2 index c5cc8344db..2fe1ae3dfb 100644 --- a/ansible/roles/mongodb/templates/mongodb.conf.j2 +++ b/ansible/roles/mongodb/templates/mongodb.conf.j2 @@ -10,7 +10,7 @@ storage: enabled: true net: - bindIp: {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} + bindIp: {{ api_interface_address }} port: {{ mongodb_port }} replication: diff --git a/ansible/roles/murano/tasks/precheck.yml b/ansible/roles/murano/tasks/precheck.yml index a06aca9eed..f070e4756d 100644 --- a/ansible/roles/murano/tasks/precheck.yml +++ b/ansible/roles/murano/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Murano API wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ murano_api_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/murano/templates/murano.conf.j2 b/ansible/roles/murano/templates/murano.conf.j2 index 5e95df8667..f704a3d7fd 100644 --- a/ansible/roles/murano/templates/murano.conf.j2 +++ b/ansible/roles/murano/templates/murano.conf.j2 @@ -4,7 +4,7 @@ debug = {{ murano_logging_debug }} log_dir = /var/log/kolla/murano {% if service_name == 'murano-api' %} -bind_host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +bind_host = {{ api_interface_address }} bind_port = {{ murano_api_port }} {% endif %} diff --git a/ansible/roles/neutron/tasks/precheck.yml b/ansible/roles/neutron/tasks/precheck.yml index e591eaf41f..e14cf9ba59 100644 --- a/ansible/roles/neutron/tasks/precheck.yml +++ b/ansible/roles/neutron/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Neutron Server wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ neutron_server_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/nova/tasks/precheck.yml b/ansible/roles/nova/tasks/precheck.yml index 4ed7368072..22af7ea465 100644 --- a/ansible/roles/nova/tasks/precheck.yml +++ b/ansible/roles/nova/tasks/precheck.yml @@ -20,7 +20,7 @@ vars: nova_api: "{{ nova_services['nova-api'] }}" wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ nova_api_port }}" connect_timeout: 1 timeout: 1 @@ -34,7 +34,7 @@ vars: nova_api: "{{ nova_services['nova-api'] }}" wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ nova_metadata_port }}" connect_timeout: 1 timeout: 1 @@ -48,7 +48,7 @@ vars: nova_novncproxy: "{{ nova_services['nova-novncproxy'] }}" wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ nova_novncproxy_port }}" connect_timeout: 1 timeout: 1 @@ -62,7 +62,7 @@ vars: nova_serialproxy: "{{ nova_services['nova-serialproxy'] }}" wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ nova_serialproxy_port }}" connect_timeout: 1 timeout: 1 @@ -76,7 +76,7 @@ vars: nova_spicehtml5proxy: "{{ nova_services['nova-spicehtml5proxy'] }}" wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ nova_spicehtml5proxy_port }}" connect_timeout: 1 timeout: 1 @@ -90,7 +90,7 @@ vars: nova_ssh: "{{ nova_services['nova-ssh'] }}" wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ nova_ssh_port }}" connect_timeout: 1 timeout: 1 @@ -104,7 +104,7 @@ vars: placement_api: "{{ nova_services['placement-api'] }}" wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ placement_api_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/nova/templates/nova.conf.j2 b/ansible/roles/nova/templates/nova.conf.j2 index 6572ea27d0..67de78882c 100644 --- a/ansible/roles/nova/templates/nova.conf.j2 +++ b/ansible/roles/nova/templates/nova.conf.j2 @@ -89,9 +89,9 @@ html5proxy_port = {{ nova_spicehtml5proxy_port }} [serial_console] enabled = true base_url = ws://{{ kolla_external_fqdn }}:{{ nova_serialproxy_port }}/ -serialproxy_host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +serialproxy_host = {{ api_interface_address }} serialproxy_port = {{ nova_serialproxy_port }} -proxyclient_address = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +proxyclient_address = {{ api_interface_address }} {% endif %} {% if service_name == "nova-compute-ironic" %} diff --git a/ansible/roles/octavia/tasks/precheck.yml b/ansible/roles/octavia/tasks/precheck.yml index 090b68ebcd..2326739cd4 100644 --- a/ansible/roles/octavia/tasks/precheck.yml +++ b/ansible/roles/octavia/tasks/precheck.yml @@ -8,7 +8,7 @@ - name: Checking free port for Octavia API wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ octavia_api_port }}" connect_timeout: 1 timeout: 1 @@ -19,7 +19,7 @@ - name: Checking free port for Octavia Health Manager wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ octavia_health_manager_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/octavia/templates/octavia.conf.j2 b/ansible/roles/octavia/templates/octavia.conf.j2 index b44c5221be..f64c75e4d6 100644 --- a/ansible/roles/octavia/templates/octavia.conf.j2 +++ b/ansible/roles/octavia/templates/octavia.conf.j2 @@ -7,7 +7,7 @@ api_handler = queue_producer transport_url = rabbit://{% for host in groups['rabbitmq'] %}{{ rabbitmq_user }}:{{ rabbitmq_password }}@{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ rabbitmq_port }}{% if not loop.last %},{% endif %}{% endfor %} -bind_host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +bind_host = {{ api_interface_address }} bind_port = {{ octavia_api_port }} [certificates] @@ -52,8 +52,8 @@ memcached_servers = {% for host in groups['memcached'] %}{{ hostvars[host]['ansi [health_manager] bind_port = {{ octavia_health_manager_port }} -bind_ip = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} -controller_ip_port_list = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ octavia_health_manager_port }} +bind_ip = {{ api_interface_address }} +controller_ip_port_list = {{ api_interface_address }}:{{ octavia_health_manager_port }} heartbeat_key =insecure [controller_worker] diff --git a/ansible/roles/openvswitch/tasks/precheck.yml b/ansible/roles/openvswitch/tasks/precheck.yml index 80bc72992a..af938f4552 100644 --- a/ansible/roles/openvswitch/tasks/precheck.yml +++ b/ansible/roles/openvswitch/tasks/precheck.yml @@ -9,7 +9,7 @@ vars: openvswitch_db: "{{ openvswitch_services['openvswitch-db-server'] }}" wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ ovsdb_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/panko/tasks/precheck.yml b/ansible/roles/panko/tasks/precheck.yml index 11646b7e3c..97fcc42654 100644 --- a/ansible/roles/panko/tasks/precheck.yml +++ b/ansible/roles/panko/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Panko API wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ panko_api_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/panko/templates/wsgi-panko.conf.j2 b/ansible/roles/panko/templates/wsgi-panko.conf.j2 index e9128b959f..bac3beabc5 100644 --- a/ansible/roles/panko/templates/wsgi-panko.conf.j2 +++ b/ansible/roles/panko/templates/wsgi-panko.conf.j2 @@ -1,5 +1,5 @@ {% set python_path = '/usr/lib/python2.7/site-packages' if kolla_install_type == 'binary' else '/var/lib/kolla/venv/lib/python2.7/site-packages' %} -Listen {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ panko_api_port }} +Listen {{ api_interface_address }}:{{ panko_api_port }} diff --git a/ansible/roles/prechecks/tasks/port_checks.yml b/ansible/roles/prechecks/tasks/port_checks.yml index 817f703a87..a2a684d69f 100644 --- a/ansible/roles/prechecks/tasks/port_checks.yml +++ b/ansible/roles/prechecks/tasks/port_checks.yml @@ -13,4 +13,4 @@ - name: Checking the api_interface ip address configuration fail: "msg='Please check the api_interface settings - interface {{ api_interface }} ip address problem'" - when: hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] is not defined + when: api_interface_address is not defined diff --git a/ansible/roles/rabbitmq/tasks/precheck.yml b/ansible/roles/rabbitmq/tasks/precheck.yml index ec5914491f..9da15ca861 100644 --- a/ansible/roles/rabbitmq/tasks/precheck.yml +++ b/ansible/roles/rabbitmq/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for RabbitMQ wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ rabbitmq_port }}" connect_timeout: 1 timeout: 1 @@ -18,7 +18,7 @@ - name: Checking free port for RabbitMQ Management wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ rabbitmq_management_port }}" connect_timeout: 1 timeout: 1 @@ -29,7 +29,7 @@ - name: Checking free port for RabbitMQ Cluster wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ rabbitmq_cluster_port }}" connect_timeout: 1 timeout: 1 @@ -40,7 +40,7 @@ - name: Checking free port for RabbitMQ EPMD wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ rabbitmq_epmd_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/sahara/tasks/precheck.yml b/ansible/roles/sahara/tasks/precheck.yml index 563ed8a989..3830380e0a 100644 --- a/ansible/roles/sahara/tasks/precheck.yml +++ b/ansible/roles/sahara/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Sahara API wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ sahara_api_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/sahara/templates/sahara.conf.j2 b/ansible/roles/sahara/templates/sahara.conf.j2 index b7fed08ad2..2dc715586e 100644 --- a/ansible/roles/sahara/templates/sahara.conf.j2 +++ b/ansible/roles/sahara/templates/sahara.conf.j2 @@ -2,7 +2,7 @@ debug = {{ sahara_logging_debug }} log_dir = /var/log/kolla/sahara port = {{ sahara_api_port }} -host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +host = {{ api_interface_address }} transport_url = rabbit://{% for host in groups['rabbitmq'] %}{{ rabbitmq_user }}:{{ rabbitmq_password }}@{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ rabbitmq_port }}{% if not loop.last %},{% endif %}{% endfor %} use_neutron = True diff --git a/ansible/roles/searchlight/tasks/precheck.yml b/ansible/roles/searchlight/tasks/precheck.yml index 40afae0238..bd1471a643 100644 --- a/ansible/roles/searchlight/tasks/precheck.yml +++ b/ansible/roles/searchlight/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Searchlight API wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ searchlight_api_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/searchlight/templates/searchlight.conf.j2 b/ansible/roles/searchlight/templates/searchlight.conf.j2 index ccce259188..e3eac130db 100644 --- a/ansible/roles/searchlight/templates/searchlight.conf.j2 +++ b/ansible/roles/searchlight/templates/searchlight.conf.j2 @@ -8,7 +8,7 @@ transport_url = rabbit://{% for host in groups['rabbitmq'] %}{{ rabbitmq_user }} [api] port = {{ searchlight_api_port }} -bind_host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +bind_host = {{ api_interface_address }} public_endpoint = {{ public_protocol }}://{{ kolla_external_fqdn }}:{{ searchlight_api_port }} workers = {{ openstack_service_workers }} diff --git a/ansible/roles/senlin/tasks/precheck.yml b/ansible/roles/senlin/tasks/precheck.yml index bbbf210522..9748a0dbfe 100644 --- a/ansible/roles/senlin/tasks/precheck.yml +++ b/ansible/roles/senlin/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Senlin API wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ senlin_api_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/solum/tasks/precheck.yml b/ansible/roles/solum/tasks/precheck.yml index b33af30e0a..0dc5e8cfe2 100644 --- a/ansible/roles/solum/tasks/precheck.yml +++ b/ansible/roles/solum/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Solum Application Deployment wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ solum_application_deployment_port }}" connect_timeout: 1 timeout: 1 @@ -18,7 +18,7 @@ - name: Checking free port for Solum Image Builder wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ solum_image_builder_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/solum/templates/solum.conf.j2 b/ansible/roles/solum/templates/solum.conf.j2 index dea3250c2b..a2b34086ab 100644 --- a/ansible/roles/solum/templates/solum.conf.j2 +++ b/ansible/roles/solum/templates/solum.conf.j2 @@ -3,7 +3,7 @@ debug = {{ solum_logging_debug }} log_dir = /var/log/kolla/solum {% if service_name == 'solum-api' %} -bind_host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +bind_host = {{ api_interface_address }} bind_port = {{ solum_application_deployment_port }} {% endif %} diff --git a/ansible/roles/swift/tasks/precheck.yml b/ansible/roles/swift/tasks/precheck.yml index 8cc5aba312..e5f622a194 100644 --- a/ansible/roles/swift/tasks/precheck.yml +++ b/ansible/roles/swift/tasks/precheck.yml @@ -54,7 +54,7 @@ - name: Checking free port for Swift Proxy Server wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ swift_proxy_server_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/swift/templates/account.conf.j2 b/ansible/roles/swift/templates/account.conf.j2 index 00606ea3ff..89ec687a79 100644 --- a/ansible/roles/swift/templates/account.conf.j2 +++ b/ansible/roles/swift/templates/account.conf.j2 @@ -3,7 +3,7 @@ bind_ip = {{ hostvars[inventory_hostname]['ansible_' + storage_interface]['ipv4' bind_port = {{ swift_account_server_port }} devices = {{ swift_devices_mount_point }} mount_check = false -log_udp_host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +log_udp_host = {{ api_interface_address }} log_udp_port = {{ fluentd_syslog_port }} log_name = {{ service_name }} log_facility = LOG_LOCAL0 diff --git a/ansible/roles/swift/templates/container.conf.j2 b/ansible/roles/swift/templates/container.conf.j2 index 1d8df62aec..b651811190 100644 --- a/ansible/roles/swift/templates/container.conf.j2 +++ b/ansible/roles/swift/templates/container.conf.j2 @@ -3,7 +3,7 @@ bind_ip = {{ hostvars[inventory_hostname]['ansible_' + storage_interface]['ipv4' bind_port = {{ swift_container_server_port }} devices = {{ swift_devices_mount_point }} mount_check = false -log_udp_host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +log_udp_host = {{ api_interface_address }} log_udp_port = {{ fluentd_syslog_port }} log_name = {{ service_name }} log_facility = LOG_LOCAL0 diff --git a/ansible/roles/swift/templates/object.conf.j2 b/ansible/roles/swift/templates/object.conf.j2 index 2629e3f367..b2fd60ef74 100644 --- a/ansible/roles/swift/templates/object.conf.j2 +++ b/ansible/roles/swift/templates/object.conf.j2 @@ -4,7 +4,7 @@ bind_port = {{ swift_object_server_port }} devices = {{ swift_devices_mount_point }} mount_check = false -log_udp_host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +log_udp_host = {{ api_interface_address }} log_udp_port = {{ fluentd_syslog_port }} log_name = {{ service_name }} log_facility = LOG_LOCAL0 diff --git a/ansible/roles/swift/templates/proxy-server.conf.j2 b/ansible/roles/swift/templates/proxy-server.conf.j2 index 4f39427114..90a13d388c 100644 --- a/ansible/roles/swift/templates/proxy-server.conf.j2 +++ b/ansible/roles/swift/templates/proxy-server.conf.j2 @@ -1,8 +1,8 @@ [DEFAULT] -bind_ip = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +bind_ip = {{ api_interface_address }} bind_port = {{ swift_proxy_server_port }} -log_udp_host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +log_udp_host = {{ api_interface_address }} log_udp_port = {{ fluentd_syslog_port }} log_name = {{ service_name }} log_facility = LOG_LOCAL0 diff --git a/ansible/roles/swift/templates/rsyncd.conf.j2 b/ansible/roles/swift/templates/rsyncd.conf.j2 index 38a40b1098..82576ff109 100644 --- a/ansible/roles/swift/templates/rsyncd.conf.j2 +++ b/ansible/roles/swift/templates/rsyncd.conf.j2 @@ -1,6 +1,6 @@ uid = swift gid = swift -address = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +address = {{ api_interface_address }} {% if inventory_hostname in groups['swift-account-server'] %} [account] diff --git a/ansible/roles/tacker/tasks/precheck.yml b/ansible/roles/tacker/tasks/precheck.yml index 0a4ac5e631..e381d072d3 100644 --- a/ansible/roles/tacker/tasks/precheck.yml +++ b/ansible/roles/tacker/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Tacker Server wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ tacker_server_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/telegraf/templates/telegraf.conf.j2 b/ansible/roles/telegraf/templates/telegraf.conf.j2 index db7718e1d8..58f6bd63c9 100644 --- a/ansible/roles/telegraf/templates/telegraf.conf.j2 +++ b/ansible/roles/telegraf/templates/telegraf.conf.j2 @@ -35,21 +35,21 @@ interfaces = [] {% if inventory_hostname in groups['haproxy'] and enable_haproxy | bool %} [[inputs.haproxy]] - servers = ["{{ haproxy_proto }}://{{ haproxy_user }}:{{ haproxy_password }}@{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ haproxy_stats_port }}"] + servers = ["{{ haproxy_proto }}://{{ haproxy_user }}:{{ haproxy_password }}@{{ api_interface_address }}:{{ haproxy_stats_port }}"] {% endif %} {% if inventory_hostname in groups['memcached'] and enable_memcached | bool %} [[inputs.memcached]] - servers = ["{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ memcached_port }}"] + servers = ["{{ api_interface_address }}:{{ memcached_port }}"] {% endif %} {% if inventory_hostname in groups['elasticsearch'] and enable_elasticsearch | bool %} [[inputs.elasticsearch]] - servers = ["{{ elasticsearch_proto }}://{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ elasticsearch_port }}"] + servers = ["{{ elasticsearch_proto }}://{{ api_interface_address }}:{{ elasticsearch_port }}"] local = true cluster_health = true {% endif %} {% if inventory_hostname in groups['rabbitmq'] and enable_rabbitmq | bool %} [[inputs.rabbitmq]] - url = "{{ rabbitmq_proto }}://{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}:{{ rabbitmq_management_port }}" + url = "{{ rabbitmq_proto }}://{{ api_interface_address }}:{{ rabbitmq_management_port }}" username = "{{ rabbitmq_user }}" password = "{{ rabbitmq_password }}" {% endif %} diff --git a/ansible/roles/trove/tasks/precheck.yml b/ansible/roles/trove/tasks/precheck.yml index d22620f3bd..041d904fa8 100644 --- a/ansible/roles/trove/tasks/precheck.yml +++ b/ansible/roles/trove/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Trove API wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ trove_api_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/trove/templates/trove.conf.j2 b/ansible/roles/trove/templates/trove.conf.j2 index d5681d920c..0dbd38c867 100644 --- a/ansible/roles/trove/templates/trove.conf.j2 +++ b/ansible/roles/trove/templates/trove.conf.j2 @@ -3,10 +3,10 @@ debug = {{ trove_logging_debug }} log_dir = /var/log/kolla/trove -host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +host = {{ api_interface_address }} bind_port = {{ trove_api_port }} -bind_host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +bind_host = {{ api_interface_address }} trove_api_workers = {{ openstack_service_workers }} auth_strategy = keystone diff --git a/ansible/roles/watcher/tasks/precheck.yml b/ansible/roles/watcher/tasks/precheck.yml index 2d57130bed..3f0401ea67 100644 --- a/ansible/roles/watcher/tasks/precheck.yml +++ b/ansible/roles/watcher/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for watcher API wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ watcher_api_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/watcher/templates/watcher.conf.j2 b/ansible/roles/watcher/templates/watcher.conf.j2 index 626626a2e0..62cd15a5a3 100644 --- a/ansible/roles/watcher/templates/watcher.conf.j2 +++ b/ansible/roles/watcher/templates/watcher.conf.j2 @@ -7,7 +7,7 @@ transport_url = rabbit://{% for host in groups['rabbitmq'] %}{{ rabbitmq_user }} {% if service_name == 'watcher-api' %} [api] -host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +host = {{ api_interface_address }} port = {{ watcher_api_port }} {% endif %} diff --git a/ansible/roles/zun/tasks/precheck.yml b/ansible/roles/zun/tasks/precheck.yml index eef7961254..c565d804f5 100644 --- a/ansible/roles/zun/tasks/precheck.yml +++ b/ansible/roles/zun/tasks/precheck.yml @@ -7,7 +7,7 @@ - name: Checking free port for Zun API wait_for: - host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" + host: "{{ api_interface_address }}" port: "{{ zun_api_port }}" connect_timeout: 1 timeout: 1 diff --git a/ansible/roles/zun/templates/zun.conf.j2 b/ansible/roles/zun/templates/zun.conf.j2 index d1f6064fff..b7c1a01a4e 100644 --- a/ansible/roles/zun/templates/zun.conf.j2 +++ b/ansible/roles/zun/templates/zun.conf.j2 @@ -4,7 +4,7 @@ log_dir = /var/log/kolla/zun transport_url = rabbit://{% for host in groups['rabbitmq'] %}{{ rabbitmq_user }}:{{ rabbitmq_password }}@{% if orchestration_engine == 'KUBERNETES' %}rabbitmq{% else %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}{% endif %}:{{ rabbitmq_port }}{% if not loop.last %},{% endif %}{% endfor %} {% if service_name == 'zun-api' %} -osapi_zun_listen = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }} +osapi_zun_listen = {{ api_interface_address }} osapi_zun_listen_port = {{ zun_api_port }} {% endif %}