labs: set tunnel IP address

Replace placeholder INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS with the
node's IP address in the data network.

To that end, the patch adds a new function hostname_to_ip.

Change-Id: I7baabdde50e62c9c8f006c19eddeca54d368666b
Implements: blueprint openstack-training-labs
This commit is contained in:
Roger Luethi 2014-08-19 08:54:56 +02:00
parent 835857994c
commit a9d74f1348
2 changed files with 6 additions and 1 deletions

View File

@ -303,6 +303,11 @@ function get_ip_from_net_and_fourth {
echo "${NET%.*}.$FOURTH_OCTET"
}
function hostname_to_ip {
local host_name=$1
getent hosts "$host_name"|awk '{print $1}'
}
function config_network {
if is_ubuntu; then
# Configuration functions will append to this file

View File

@ -68,7 +68,7 @@ iniset_sudo $conf securitygroup firewall_driver neutron.agent.linux.iptables_fir
iniset_sudo $conf securitygroup enable_security_group True
# Under the ovs section
iniset_sudo $conf ovs local_ip INSTANCE_TUNNELS_INTERFACE_IP_ADDRESS
iniset_sudo $conf ovs local_ip "$(hostname_to_ip compute-data)"
iniset_sudo $conf ovs tunnel_type gre
iniset_sudo $conf ovs enable_tunneling True