puppet-midonet/manifests/resources/interface_up.pp
Alex Ruiz Estradera 6b958074d3 Add /bin path to command for interface up
Change-Id: I1fc3245b404ac4a9883cc68875d4e65632449819
2016-11-28 10:25:26 +01:00

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'"
}
}