6b958074d3
Change-Id: I1fc3245b404ac4a9883cc68875d4e65632449819
18 lines
513 B
Puppet
18 lines
513 B
Puppet
# == Resource: midonet::resources::interface_up
|
|
#
|
|
# Brings an interface with the corresponding IP address up. Necessary for the
|
|
# BGP setup, otherwise the bgpd process won't start.
|
|
#
|
|
|
|
define midonet::resources::interface_up(
|
|
String $mac_address
|
|
) {
|
|
|
|
exec { 'bring_interface_up':
|
|
path => '/usr/bin:/usr/sbin:/sbin:/bin',
|
|
command => "ip link set dev $(ip -o link | grep ${mac_address} | awk '{print \$2}' | tr -d ':') up",
|
|
onlyif => "ip -o link | grep ${mac_address} | grep 'state DOWN'"
|
|
}
|
|
|
|
}
|