diff --git a/manifests/bridge.pp b/manifests/bridge.pp index da4825b6..bd78de42 100644 --- a/manifests/bridge.pp +++ b/manifests/bridge.pp @@ -1,16 +1,15 @@ -class vswitch::bridge ( - $name, +define vswitch::bridge ( $external_ids = "", $ensure = "present" ) { if $external_ids == "" { vs_bridge { $name: ensure => $ensure - } <- Class['vswitch'] + } } else { vs_bridge { $name: external_ids => $external_ids, ensure => $ensure - } <- Class['vswitch'] + } } } diff --git a/manifests/ovs.pp b/manifests/ovs.pp index 709cf59e..31bdae3c 100644 --- a/manifests/ovs.pp +++ b/manifests/ovs.pp @@ -20,4 +20,7 @@ class vswitch::ovs( hasstatus => true, status => "/etc/init.d/openvswitch-switch status", } + + Service['openvswitch-switch'] -> Vs_port<||> + Service['openvswitch-switch'] -> Vs_bridge<||> } diff --git a/manifests/port.pp b/manifests/port.pp index c7abfb58..89857230 100644 --- a/manifests/port.pp +++ b/manifests/port.pp @@ -1,10 +1,9 @@ -class vswitch::port ( - $interface, +define vswitch::port ( $bridge, $ensure = present ) { - vs_port { $interface: + vs_port { $name: bridge => $bridge, ensure => $ensure - } <- Class['vswitch'] + } }