Browse Source

Merge "adaptions for _bridge_config_example recipe for multi-node demo"

Jenkins 3 years ago
parent
commit
f417e75be1
1 changed files with 11 additions and 7 deletions
  1. 11
    7
      recipes/_bridge_config_example.rb

+ 11
- 7
recipes/_bridge_config_example.rb View File

@@ -29,6 +29,11 @@ class ::Chef::Recipe
29 29
   include ::Openstack
30 30
 end
31 31
 
32
+# set and get name for tun interface (can be overwritten in the environment,
33
+# like shown for the multi-node scenario in the openstack-chef-repo)
34
+node.default['openstack']['network']['tun_network_bridge_interface'] = 'eth-tun'
35
+tun_interface = node['openstack']['network']['tun_network_bridge_interface']
36
+
32 37
 # Helper for creating dummy interfaces for ovs bridges on jenkins test nodes and
33 38
 # in testing vagrant boxes.
34 39
 # 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
47 52
   not_if 'ip link show | grep eth-vlan'
48 53
 end.run_action(:run)
49 54
 
50
-execute 'create eth-tun dummy interface' do
51
-  command 'ip link add eth-tun type dummy;'\
52
-    'ip link set dev eth-tun up;'\
53
-    'ip addr add 10.0.0.201/24 dev eth-tun'
54
-  not_if 'ip link show | grep eth-tun'
55
+execute "create #{tun_interface} dummy interface" do
56
+  command "ip link add #{tun_interface} type dummy;"\
57
+    "ip link set dev #{tun_interface} up;"\
58
+    "ip addr add 10.0.0.201/24 dev #{tun_interface}"
59
+  not_if "ip link show | grep #{tun_interface}"
55 60
 end.run_action(:run)
56 61
 
57 62
 # reload node attributes to get configuration for newly created dummy interfaces
@@ -67,12 +72,11 @@ node.default['openstack']['network']['plugins']['openvswitch']['conf']
67 72
 node.default['openstack']['network_l3']['external_network_bridge_interface'] = 'eth-ext'
68 73
 
69 74
 # tunnel bridge
70
-node.default['openstack']['network']['tun_network_bridge_interface'] = 'eth-tun'
71 75
 node.default['openstack']['network']['plugins']['openvswitch']['conf']
72 76
 .[]('OVS')['tunnel_bridge'] = 'br-tun'
73 77
 node.default['openstack']['network']['plugins']['openvswitch']['conf']
74 78
 .[]('OVS')['local_ip'] =
75
-  address_for(node.default['openstack']['network']['tun_network_bridge_interface'])
79
+  address_for(tun_interface)
76 80
 node.default['openstack']['network']['plugins']['openvswitch']['conf']
77 81
 .[]('AGENT')['tunnel_types'] = 'gre,vxlan'
78 82
 

Loading…
Cancel
Save