From 59d11d4207fc2c0bf28c06ae1fb981ecc274d34b Mon Sep 17 00:00:00 2001 From: Endre Karlson Date: Sat, 6 Oct 2012 19:58:10 +0200 Subject: [PATCH] Add support for external ids --- lib/puppet/provider/vs_bridge/ovs.rb | 1 + lib/puppet/type/vs_bridge.rb | 2 +- manifests/bridge.pp | 9 ++++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/puppet/provider/vs_bridge/ovs.rb b/lib/puppet/provider/vs_bridge/ovs.rb index a2bdc7be..dea72b6f 100644 --- a/lib/puppet/provider/vs_bridge/ovs.rb +++ b/lib/puppet/provider/vs_bridge/ovs.rb @@ -19,6 +19,7 @@ Puppet::Type.type(:vs_bridge).provide(:ovs) do def _split(string, splitter="\n") return Hash[string.split(splitter).map{|i| i.split("=")}] + end def external_ids result = vsctl("br-get-external-id", @resource[:bridge]) diff --git a/lib/puppet/type/vs_bridge.rb b/lib/puppet/type/vs_bridge.rb index b19a0cda..6736b418 100644 --- a/lib/puppet/type/vs_bridge.rb +++ b/lib/puppet/type/vs_bridge.rb @@ -11,7 +11,7 @@ module Puppet desc "The bridge to configure" end - newparam(:external_ids) do + newproperty(:external_ids) do desc "External IDs for the bridge" end end diff --git a/manifests/bridge.pp b/manifests/bridge.pp index 505ffe12..1a9fdfff 100644 --- a/manifests/bridge.pp +++ b/manifests/bridge.pp @@ -1,7 +1,10 @@ class vswitch::bridge ( - $ensure + $name, + $external_ids = "", + $ensure = "present" ) { - vs_bridge { $br_name: - ensure => $ensure + vs_bridge { $name: + external_ids => $external_ids, + ensure => $ensure } }