Alejandro Andreu c5f623c612 BGP working now on puppet-midonet
Change-Id: Ic5bd6e8301a3e2fc4ac5b85ea745b0f70f305751
2016-08-26 10:50:00 +02:00

17 lines
485 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':
command => "/usr/sbin/ip link set dev $(ip -o link | grep ${mac_address} | awk '{print \$2}' | tr -d ':') up",
onlyif => "/usr/sbin/ip -o link | grep ${mac_address} | grep 'state DOWN'"
}
}