diff --git a/ansible/roles/loadbalancer/tasks/precheck.yml b/ansible/roles/loadbalancer/tasks/precheck.yml index 41cca0f75d..196dff8b0c 100644 --- a/ansible/roles/loadbalancer/tasks/precheck.yml +++ b/ansible/roles/loadbalancer/tasks/precheck.yml @@ -107,7 +107,7 @@ - name: Checking the kolla_external_vip_interface is active assert: - that: hostvars[inventory_hostname].ansible_facts[kolla_external_vip_interface]['active'] + that: hostvars[inventory_hostname].ansible_facts[kolla_external_vip_interface | replace('-', '_')]['active'] fail_msg: "Please check the kolla_external_vip_interface settings - interface {{ kolla_external_vip_interface }} is not active" when: - haproxy_enable_external_vip | bool diff --git a/ansible/roles/prechecks/tasks/port_checks.yml b/ansible/roles/prechecks/tasks/port_checks.yml index ea3e7d72f7..576baa6d2d 100644 --- a/ansible/roles/prechecks/tasks/port_checks.yml +++ b/ansible/roles/prechecks/tasks/port_checks.yml @@ -5,7 +5,7 @@ - name: Checking the api_interface is active fail: "msg='Please check the api_interface settings - interface {{ api_interface }} is not active'" - when: not hostvars[inventory_hostname].ansible_facts[api_interface]['active'] + when: not hostvars[inventory_hostname].ansible_facts[api_interface | replace('-', '_')]['active'] # kolla_address handles relevant address check - name: Checking the api_interface ip address configuration diff --git a/doc/source/admin/production-architecture-guide.rst b/doc/source/admin/production-architecture-guide.rst index e5cd896f9c..7aa2d7e074 100644 --- a/doc/source/admin/production-architecture-guide.rst +++ b/doc/source/admin/production-architecture-guide.rst @@ -78,12 +78,6 @@ In Kolla operators should configure following network interfaces: with the bare metal cloud hosts in order to provide DHCP leases with PXE boot options. Defaults to ``network_interface``. -.. warning:: - - Ansible facts does not recognize interface names containing dashes, - in example ``br-ex`` or ``bond-0`` cannot be used because ansible will read - them as ``br_ex`` and ``bond_0`` respectively. - .. _address-family-configuration: Address family configuration (IPv4/IPv6) diff --git a/doc/source/reference/logging-and-monitoring/prometheus-guide.rst b/doc/source/reference/logging-and-monitoring/prometheus-guide.rst index 9a3c8333e4..973a8ce1ed 100644 --- a/doc/source/reference/logging-and-monitoring/prometheus-guide.rst +++ b/doc/source/reference/logging-and-monitoring/prometheus-guide.rst @@ -106,7 +106,7 @@ following: static_configs: - targets: {% for host in groups['prometheus'] %} - - '{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ 3456 }}' + - '{{ hostvars[host][('ansible_' + hostvars[host]['api_interface'] | replace('-','_'))]['ipv4']['address'] }}:{{ 3456 }}' {% endfor %} The jobs, ``custom``, and ``custom_template`` would be appended to the default diff --git a/roles/cephadm/tasks/main.yml b/roles/cephadm/tasks/main.yml index 7dcacd77bc..63ba7b0e39 100644 --- a/roles/cephadm/tasks/main.yml +++ b/roles/cephadm/tasks/main.yml @@ -33,7 +33,7 @@ - name: Bootstrap cephadm vars: - mon_ip: "{{ hostvars[inventory_hostname]['ansible_' + api_interface_name].ipv4.address }}" + mon_ip: "{{ hostvars[inventory_hostname]['ansible_' + api_interface_name | replace('-','_')].ipv4.address }}" command: cmd: > cephadm @@ -80,7 +80,7 @@ ceph_conf_fixed: | [global] fsid = {{ ceph_fsid }} - mon_host = {% for host in groups['all'] %} {{ hostvars[host]['ansible_' + api_interface_name].ipv4.address }} {% if not loop.last %},{% endif %} {% endfor %} + mon_host = {% for host in groups['all'] %} {{ hostvars[host]['ansible_' + api_interface_name | replace('-','_')].ipv4.address }} {% if not loop.last %},{% endif %} {% endfor %} copy: content: "{{ ceph_conf_fixed }}" dest: "/etc/ceph/ceph.conf.fixed" diff --git a/tests/run.yml b/tests/run.yml index 5c68c1fa93..b93ac2ce61 100644 --- a/tests/run.yml +++ b/tests/run.yml @@ -349,7 +349,7 @@ KOLLA_SWIFT_BASE_IMAGE: "{{ docker_image_prefix }}swift-base:{{ docker_image_tag }}" # NOTE(yoctozepto): no IPv6 for now STORAGE_NODES: "{{ groups['all'] | map('extract', hostvars, - ['ansible_'+api_interface_name, 'ipv4', 'address']) + ['ansible_'+api_interface_name | replace('-','_') , 'ipv4', 'address']) | join(' ') }}" CONTAINER_ENGINE: "{{ container_engine }}" when: scenario == 'swift'