Support configuring API interface via overcloud inventory file

This is to support different hosts, having API interfaces with
different names.
This commit is contained in:
Doug Szumski 2018-01-17 13:00:10 +00:00 committed by stack
parent fe3fecbf19
commit 6213260698
6 changed files with 20 additions and 5 deletions

View File

@ -1,4 +1,16 @@
---
- name: Set interfaces for overcloud hosts
hosts: overcloud
tags:
- config
- kolla-ansible
gather_facts: False
tasks:
- name: Set API interface
set_fact:
kolla_api_interface: "{{ internal_net_name | net_interface | replace('-', '_') }}"
when: internal_net_name in network_interfaces
- name: Ensure Kolla Ansible is configured
hosts: localhost
tags:
@ -35,7 +47,6 @@
- name: Set facts containing the controller network interfaces
set_fact:
kolla_network_interface: "{{ internal_net_name | net_interface(controller_host) | replace('-', '_') }}"
kolla_api_interface: "{{ internal_net_name | net_interface(controller_host) | replace('-', '_') }}"
kolla_storage_interface: "{{ storage_net_name | net_interface(controller_host) | replace('-', '_') }}"
kolla_cluster_interface: "{{ storage_mgmt_net_name | net_interface(controller_host) | replace('-', '_') }}"
kolla_provision_interface: "{{ provision_wl_net_name | net_interface(controller_host) | replace('-', '_') }}"

View File

@ -69,6 +69,7 @@ kolla_overcloud_inventory_pass_through_host_vars:
- "ansible_host"
- "ansible_port"
- "ansible_ssh_private_key_file"
- "kolla_api_interface"
###############################################################################
# Kolla-ansible global configuration options.

View File

@ -76,12 +76,17 @@ docker_registry_password: "{{ kolla_docker_registry_password }}"
# Yet another way to workaround the naming problem is to create a bond for the
# interface on all hosts and give the bond name here. Similar strategy can be
# followed for other types of interfaces.
#
# NOTE: The following interfaces are configured via the inventory and are
# therefore not set here:
#
# - api_interface
network_interface: "{{ kolla_network_interface }}"
# These can be adjusted for even more customization. The default is the same as
# the 'network_interface'. These interfaces must contain an IPv4 address.
kolla_external_vip_interface: "{{ kolla_external_vip_interface }}"
api_interface: "{{ kolla_api_interface }}"
storage_interface: "{{ kolla_storage_interface }}"
cluster_interface: "{{ kolla_cluster_interface }}"
dns_interface: "{{ kolla_dns_interface }}"

View File

@ -17,7 +17,7 @@
# These hostnames must be resolvable from your deployment host
{% for host in groups.get(group, []) %}
{% set host_hv=hostvars[host] %}
{{ host }}{% for hv_name in kolla_overcloud_inventory_pass_through_host_vars %}{% if hv_name in host_hv %} {{ hv_name }}={{ host_hv[hv_name] }}{% endif %}{% endfor %}
{{ host }}{% for hv_name in kolla_overcloud_inventory_pass_through_host_vars %}{% if hv_name in host_hv %} {{ hv_name | regex_replace('^kolla_(.*)$', '\1') }}={{ host_hv[hv_name] }}{% endif %}{% endfor %}
{% endfor %}

View File

@ -83,7 +83,6 @@
docker_namespace: "fake-namespace"
network_interface: "eth0"
kolla_external_vip_interface: "eth1"
api_interface: "eth2"
storage_interface: "eth3"
cluster_interface: "eth4"
dns_interface: "eth5"

View File

@ -174,7 +174,6 @@
docker_registry_password: "fake-password"
network_interface: "eth0"
kolla_external_vip_interface: "eth1"
api_interface: "eth2"
storage_interface: "eth3"
cluster_interface: "eth4"
dns_interface: "eth5"