From d4ac12905ecf33b81fbfe16334ed4a53f892ff19 Mon Sep 17 00:00:00 2001 From: Jan Klare Date: Fri, 29 Apr 2016 12:14:06 -0500 Subject: [PATCH] adaptions for _bridge_config_example recipe for multi-node demo - minor adaptions to demo recipe to allow multi node scenario with working overlay network on vagrant from openstack-chef-repo Change-Id: Idc605fed9066abbfbc1d6cd67805bf2a1aa1c31c --- recipes/_bridge_config_example.rb | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/recipes/_bridge_config_example.rb b/recipes/_bridge_config_example.rb index 5eb99b03..e903eff2 100644 --- a/recipes/_bridge_config_example.rb +++ b/recipes/_bridge_config_example.rb @@ -29,6 +29,11 @@ class ::Chef::Recipe include ::Openstack end +# set and get name for tun interface (can be overwritten in the environment, +# like shown for the multi-node scenario in the openstack-chef-repo) +node.default['openstack']['network']['tun_network_bridge_interface'] = 'eth-tun' +tun_interface = node['openstack']['network']['tun_network_bridge_interface'] + # Helper for creating dummy interfaces for ovs bridges on jenkins test nodes and # in testing vagrant boxes. # The created interfaces do not work for real network traffic, but are needed to @@ -47,11 +52,11 @@ execute 'create eth-vlan dummy interface' do not_if 'ip link show | grep eth-vlan' end.run_action(:run) -execute 'create eth-tun dummy interface' do - command 'ip link add eth-tun type dummy;'\ - 'ip link set dev eth-tun up;'\ - 'ip addr add 10.0.0.201/24 dev eth-tun' - not_if 'ip link show | grep eth-tun' +execute "create #{tun_interface} dummy interface" do + command "ip link add #{tun_interface} type dummy;"\ + "ip link set dev #{tun_interface} up;"\ + "ip addr add 10.0.0.201/24 dev #{tun_interface}" + not_if "ip link show | grep #{tun_interface}" end.run_action(:run) # reload node attributes to get configuration for newly created dummy interfaces @@ -67,12 +72,11 @@ node.default['openstack']['network']['plugins']['openvswitch']['conf'] node.default['openstack']['network_l3']['external_network_bridge_interface'] = 'eth-ext' # tunnel bridge -node.default['openstack']['network']['tun_network_bridge_interface'] = 'eth-tun' node.default['openstack']['network']['plugins']['openvswitch']['conf'] .[]('OVS')['tunnel_bridge'] = 'br-tun' node.default['openstack']['network']['plugins']['openvswitch']['conf'] .[]('OVS')['local_ip'] = - address_for(node.default['openstack']['network']['tun_network_bridge_interface']) + address_for(tun_interface) node.default['openstack']['network']['plugins']['openvswitch']['conf'] .[]('AGENT')['tunnel_types'] = 'gre,vxlan'