puppet-infracloud/manifests/veth.pp
Yolanda Robla 700a70c35f Parameterize vlan name on veth
This is different from east and west, so cannot be
hardcoded.

Change-Id: I848222154b715ab035f7ef6e33a3e6dc98833c63
2016-01-13 17:27:32 +01:00

28 lines
883 B
Puppet

# Create a veth pair to connect the neutron bridge to the vlan bridge
class infracloud::veth (
$br_name,
) {
exec { 'create veth pair':
command => '/sbin/ip link add veth1 type veth peer name veth2',
unless => '/sbin/ip link show | /bin/grep veth1 && /sbin/ip link show | /bin/grep veth2',
}
exec { 'attach veth pair':
command => "/sbin/brctl addif ${br_name} veth1",
unless => "/sbin/brctl show ${br_name} | /bin/grep veth1",
require => Exec['create veth pair'],
}
exec { 'turn on veth1':
command => '/sbin/ip link set dev veth1 up',
unless => '/sbin/ip link show dev veth1 | /bin/grep "state UP"',
require => Exec['attach veth pair'],
}
exec { 'turn on veth2':
command => '/sbin/ip link set dev veth2 up',
unless => '/sbin/ip link show dev veth2 | /bin/grep "state UP"',
require => Exec['attach veth pair'],
}
}