From ebf3c76a18bdf60737a466e649a37cc95729b43e Mon Sep 17 00:00:00 2001 From: Rob Date: Fri, 8 May 2015 09:08:49 -0400 Subject: [PATCH 1/3] Use the libvirt_service parameter instead of hard-coding libvirt-bin --- manifests/init.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index 14be7a5..75a0019 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -147,7 +147,7 @@ # Optional changes to the /etc/default file (on Debian) if $deb_default != false { - file { '/etc/default/libvirt-bin': + file { "/etc/default/${libvirt_service}": owner => 'root', group => 'root', mode => '0644', From 8942a696a91450fcb08ea725139680498c107686 Mon Sep 17 00:00:00 2001 From: Rob Date: Fri, 8 May 2015 09:13:15 -0400 Subject: [PATCH 2/3] The service name is aliased so use the static name --- manifests/network.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/network.pp b/manifests/network.pp index 929189a..3231735 100644 --- a/manifests/network.pp +++ b/manifests/network.pp @@ -89,7 +89,7 @@ path => '/bin:/usr/bin', user => 'root', provider => 'posix', - require => Service[$::libvirt::params::libvirt_service], + require => Service['libvirtd'], environment => ['LC_ALL=en_US.utf8', ], } From e0815430a3b7899d722e88e1957f92c850f09f6d Mon Sep 17 00:00:00 2001 From: Rob Date: Fri, 8 May 2015 09:14:35 -0400 Subject: [PATCH 3/3] Adding some support for defining vlans and virtualports --- manifests/network.pp | 2 ++ templates/network.xml.erb | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/manifests/network.pp b/manifests/network.pp index 3231735..44c017b 100644 --- a/manifests/network.pp +++ b/manifests/network.pp @@ -77,6 +77,8 @@ $ip = undef, $ipv6 = undef, $mac = undef, + $vlan = undef, + $virtualport = undef, ) { validate_bool ($autostart) validate_re ($ensure, '^(present|defined|enabled|running|undefined|absent)$', diff --git a/templates/network.xml.erb b/templates/network.xml.erb index 98be69f..9dc1c6e 100644 --- a/templates/network.xml.erb +++ b/templates/network.xml.erb @@ -46,4 +46,18 @@ <%- end-%> <%- end-%> <%-end-%> + <%- if @vlan -%> + <%- @vlan.each do |vlan| -%> + > + <%- vlan['tags'].each do |tag| -%> + ' <%= tag['native_mode'] ? "nativeMode='#{tag['native_mode']}'" : '' %> /> + <%- end -%> + + <%- end -%> + <%- end -%> + <%- if @virtualport -%> + <%- @virtualport.each do |virtualport| -%> + '/> + <%- end -%> + <%- end -%>