Skip to content

Fixing kolla's problem with ansible var precedence

  • title: "Fixing kolla's problem with ansible var precedence"
  • state: abandoned from 2.0.3
  • url: 37cc38da
diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml
index 0d4757f3..a5d46e6e 100644
--- a/ansible/group_vars/all.yml
+++ b/ansible/group_vars/all.yml
@@ -77,10 +77,12 @@ keepalived_virtual_router_id: "51"
 ####################
 # Networking options
 ####################
-kolla_external_vip_interface: "{{ network_interface }}"
-api_interface: "{{ network_interface }}"
-storage_interface: "{{ network_interface }}"
-tunnel_interface: "{{ network_interface }}"
+network_interface: "{{ default_network_interface }}"
+kolla_external_vip_interface: "{{ default_kolla_external_vip_interface | default( network_interface ) }}"
+api_interface: "{{ default_api_interface | default( network_interface ) }}"
+storage_interface: "{{ default_storage_interface | default( network_interface ) }}"
+tunnel_interface: "{{ default_tunnel_interface |  default( network_interface ) }}"
+neutron_external_interface: "{{ default_neutron_external_interface }}"
 
 # Valid options are [ openvswitch, linuxbridge ]
 neutron_plugin_agent: "openvswitch"



diff --git a/dev/vagrant/bootstrap.sh b/dev/vagrant/bootstrap.sh
index e365b851..d9044ae1 100644
--- a/dev/vagrant/bootstrap.sh
+++ b/dev/vagrant/bootstrap.sh
@@ -138,8 +138,8 @@ function configure_kolla {
     sed -i -r "s,^[# ]*docker_namespace:.+$,docker_namespace: \"lokolla\"," /etc/kolla/globals.yml
     sed -i -r "s,^[# ]*docker_insecure_registry:.+$,docker_insecure_registry: \"True\"," /etc/kolla/globals.yml
     # Set network interfaces
-    sed -i -r "s,^[# ]*network_interface:.+$,network_interface: \"eth1\"," /etc/kolla/globals.yml
-    sed -i -r "s,^[# ]*neutron_external_interface:.+$,neutron_external_interface: \"eth2\"," /etc/kolla/globals.yml
+    sed -i -r "s,^[# ]*default_network_interface:.+$,default_network_interface: \"eth1\"," /etc/kolla/globals.yml
+    sed -i -r "s,^[# ]*default_neutron_external_interface:.+$,default_neutron_external_interface: \"eth2\"," /etc/kolla/globals.yml
 }
 
 # Configure the operator node and install some additional packages.



diff --git a/doc/advanced-configuration.rst b/doc/advanced-configuration.rst
index 6fe857fb..584adb93 100644
--- a/doc/advanced-configuration.rst
+++ b/doc/advanced-configuration.rst
@@ -14,10 +14,10 @@ URL is assigned to an IP address that is different than the IP address
 shared by the internal and admin URLs.
 
 The configuration parameters related to these options are:
-- kolla_internal_vip_address
-- network_interface
-- kolla_external_vip_address
-- kolla_external_vip_interface
+  - kolla_internal_vip_address
+  - default_network_interface
+  - kolla_external_vip_address
+  - default_kolla_external_vip_interface
 
 For the combined option, set the two variables below, while allowing the
 other two to accept their default values.  In this configuration all REST
@@ -25,7 +25,7 @@ API requests, internal and external, will flow over the same network.
 ::
 
     kolla_internal_vip_address: "10.10.10.254"
-    network_interface: "eth0"
+    default_network_interface: "eth0"
 
 For the separate option, set these four variables.  In this configuration
 the internal and external REST API requests can flow over separate
@@ -33,9 +33,9 @@ networks.
 ::
 
     kolla_internal_vip_address: "10.10.10.254"
-    network_interface: "eth0"
+    default_network_interface: "eth0"
     kolla_external_vip_address: "10.10.20.254"
-    kolla_external_vip_interface: "eth1"
+    default_kolla_external_vip_interface: "eth1"
 
 
 Fully Qualified Domain Name Configuration



diff --git a/doc/quickstart.rst b/doc/quickstart.rst
index 82b9792b..36a25fd5 100644
--- a/doc/quickstart.rst
+++ b/doc/quickstart.rst
@@ -404,7 +404,7 @@ parameters: kolla_base_distro, kolla_install_type.
 
 Please specify an unused IP address in the network to act as a VIP for
 kolla\_internal\_vip\_address. The VIP will be used with keepalived and
-added to the "api\_interface" as specified in the globals.yml
+added to the "default\_api\_interface" as specified in the globals.yml
 
 ::
 
@@ -422,24 +422,19 @@ Note this method is not recommended and generally not tested by the
 Kolla community, but included since sometimes a free IP is not available
 in a testing environment.
 
-The "network\_interface" variable is the interface to which Kolla binds API
-services. For example, when starting up Mariadb it will bind to the
-IP on the interface list in the "network\_interface" variable.
+The ``default_network_interface`` variable is the interface to which Kolla
+binds API services. For example, when starting up Mariadb it will bind to the
+IP on the interface list in the ``default_network_interface`` variable. ::
 
-::
-
-    network_interface: "eth0"
+    default_network_interface: "eth0"
 
-The "neutron\_external\_interface" variable is the interface that will
+The ``default_neutron_external_interface`` variable is the interface that will
 be used for the external bridge in Neutron. Without this bridge the deployment
-instance traffic will be unable to access the rest of the Internet. In
-the case of a single interface on a machine, a veth pair may be used where
-one end of the veth pair is listed here and the other end is in a bridge on
-the system.
-
-::
+instance traffic will be unable to access the rest of the Internet. In the case
+of a single interface on a machine, a veth pair may be used where one end of
+the veth pair is listed here and the other end is in a bridge on the system. ::
 
-    neutron_external_interface: "eth1"
+    default_neutron_external_interface: "eth1"
 
 If using a local docker registry, set the docker\_registry information where
 the local registry is operating on IP address 192.168.1.100 and the port 4000.


diff --git a/etc/kolla/globals.yml b/etc/kolla/globals.yml
index 0a2264d5..2a03af35 100644
--- a/etc/kolla/globals.yml
+++ b/etc/kolla/globals.yml
@@ -22,7 +22,7 @@
 # This should be a VIP, an unused IP on your network that will float between
 # the hosts running keepalived for high-availability. When running an All-In-One
 # without haproxy and keepalived, this should be the first IP on your
-# 'network_interface' as set in the Networking section below.
+# 'default_network_interface' as set in the Networking section below.
 kolla_internal_vip_address: "10.10.10.254"
 
 # This is the DNS name that maps to the kolla_internal_vip_address VIP. By
@@ -58,20 +58,27 @@ kolla_internal_vip_address: "10.10.10.254"
 # This interface is what all your api services will be bound to by default.
 # Additionally, all vxlan/tunnel and storage network traffic will go over this
 # interface by default. This interface must contain an IPv4 address.
-network_interface: "eth0"
+default_network_interface: "eth0"
 
 # These can be adjusted for even more customization. The default is the same as
-# the 'network_interface'. These interfaces must container an IPv4 address.
-#kolla_external_vip_interface: "{{ network_interface }}"
-#api_interface: "{{ network_interface }}"
-#storage_interface: "{{ network_interface }}"
-#tunnel_interface: "{{ network_interface }}"
+# the 'default_network_interface'. These interfaces must contain an IPv4 address.
+#default_kolla_external_vip_interface: "{{ default_network_interface }}"
+#default_api_interface: "{{ default_network_interface }}"
+#default_storage_interface: "{{ default_network_interface }}"
+#default_cluster_interface: "{{ default_network_interface }}"
+#default_tunnel_interface: "{{ default_network_interface }}"
 
 # This is the raw interface given to neutron as its external network port. Even
 # though an IP address can exist on this interface, it will be unusable in most
 # configurations. It is recommended this interface not be configured with any IP
 # addresses for that reason.
-neutron_external_interface: "eth1"
+default_neutron_external_interface: "eth1"
+
+#Any of the 'default_*_interface' variables can be customized even more in the
+#inventory file. If any host have different configuration of the interfaces then
+#its definition in the inventory should specify them without the 'default_'
+#prefix. Check inventory file for the example usage.
+
 
 # Valid options are [ openvswitch, linuxbridge ]
 #neutron_plugin_agent: "openvswitch"
@@ -87,9 +94,10 @@ neutron_external_interface: "eth1"
 ####################
 # TLS options
 ####################
-# To provide encryption and authentication on the kolla_external_vip_interface,
-# TLS can be enabled.  When TLS is enabled, certificates must be provided to
-# allow clients to perform authentication.
+# To provide encryption and authentication on the 
+# default_kolla_external_vip_interface, TLS can be enabled.  When TLS is 
+# enabled, certificates must be provided to allow clients to perform 
+# authentication.
 #kolla_enable_tls_external: "no"
 #kolla_external_fqdn_cert: "{{ node_config_directory }}/certificates/haproxy.pem"



diff --git a/tools/deploy_aio.sh b/tools/deploy_aio.sh
index cccf9b1e..13ffe2b8 100755
--- a/tools/deploy_aio.sh
+++ b/tools/deploy_aio.sh
@@ -25,6 +25,10 @@ function sanity_check {
     # Wait for service ready
     sleep 15
     source /etc/kolla/admin-openrc.sh
+    # TODO(Jeffrey4l): Restart the memcached container to cleanup all cache.
+    # Remove this after this bug is fixed
+    # https://bugs.launchpad.net/oslo.cache/+bug/1590779
+    docker restart memcached
     nova --debug service-list
     neutron --debug agent-list
     tools/init-runonce
@@ -59,8 +63,8 @@ kolla_base_distro: "${KOLLA_BASE}"
 kolla_install_type: "${KOLLA_TYPE}"
 kolla_internal_vip_address: "169.254.169.10"
 docker_restart_policy: "never"
-network_interface: "${PRIVATE_INTERFACE}"
-neutron_external_interface: "fake_interface"
+default_network_interface: "${PRIVATE_INTERFACE}"
+default_neutron_external_interface: "fake_interface"
 enable_horizon: "no"
 enable_heat: "no"