From b1ee520eba6b7163bb3c27ccd498e0bce39b705e Mon Sep 17 00:00:00 2001 From: "Paulo E. Castro" Date: Mon, 6 Oct 2014 17:15:10 +0100 Subject: [PATCH 1/4] Fedora is pretty much the same class as CentOS --- lib/puppet/provider/virt/openvz.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet/provider/virt/openvz.rb b/lib/puppet/provider/virt/openvz.rb index 2e5ec6a..4c34dff 100644 --- a/lib/puppet/provider/virt/openvz.rb +++ b/lib/puppet/provider/virt/openvz.rb @@ -13,7 +13,7 @@ when "Ubuntu", "Debian" @@vzcache = "/var/lib/vz/template/cache/" @@vzconf = "/etc/vz/conf/" - when "CentOS" + when "CentOS", "Fedora" @@vzcache = "/vz/template/cache/" @@vzconf = "/etc/vz/conf/" else From c04740e774f425447aa94811da717b64459aaa94 Mon Sep 17 00:00:00 2001 From: Tristan Helmich Date: Wed, 18 Jun 2014 20:03:07 +0200 Subject: [PATCH 2/4] Ensure future parser compatibility (>3.5.1) Since Puppet 3.5.1 the future parser no longer matches upper case words in a selector statement as they are treated as a custom resource type. See https://tickets.puppetlabs.com/browse/PUP-2800?focusedCommentId=76016&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-76016 for details. --- manifests/params.pp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 1bd56ca..dbaa719 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -7,25 +7,25 @@ $confdir = '/etc/vz/conf/' $vedir = '/var/lib/vz/' # You can update here with your custom value $packages = $operatingsystem ? { - Debian => [ "linux-image-${kernelmajversion}-openvz-686", 'vzctl', 'vzquota' ], - Ubuntu => [ "linux-image-${kernelmajversion}-openvz-686", 'vzctl', 'vzquota' ], - Fedora => [ 'ovzkernel', 'vzctl', 'vzquota' ], + 'Debian' => [ "linux-image-${kernelmajversion}-openvz-686", 'vzctl', 'vzquota' ], + 'Ubuntu' => [ "linux-image-${kernelmajversion}-openvz-686", 'vzctl', 'vzquota' ], + 'Fedora' => [ 'ovzkernel', 'vzctl', 'vzquota' ], } } /^physical|^kvm/: { $servicename = 'libvirtd' $packages = $operatingsystem ? { - Debian => [ 'kvm', 'libvirt0', 'libvirt-bin', 'qemu', 'virtinst', 'libvirt-ruby' ], - Ubuntu => [ 'ubuntu-virt-server', 'python-vm-builder', 'kvm', 'qemu', 'qemu-kvm', 'libvirt-ruby' ], - Fedora => [ 'kvm', 'qemu', 'libvirt', 'python-virtinst', 'ruby-libvirt' ], + 'Debian' => [ 'kvm', 'libvirt0', 'libvirt-bin', 'qemu', 'virtinst', 'libvirt-ruby' ], + 'Ubuntu' => [ 'ubuntu-virt-server', 'python-vm-builder', 'kvm', 'qemu', 'qemu-kvm', 'libvirt-ruby' ], + 'Fedora' => [ 'kvm', 'qemu', 'libvirt', 'python-virtinst', 'ruby-libvirt' ], } } /^xen/: { $servicename = 'libvirtd' $packages = $operatingsystem ? { - Debian => [ 'linux-image-xen-686', 'xen-hypervisor', 'xen-tools', 'xen-utils' ], - Ubuntu => [ 'python-vm-builder', 'ubuntu-xen-server', 'libvirt-ruby' ], - Fedora => [ 'kernel-xen', 'xen', 'ruby-libvirt' ], + 'Debian' => [ 'linux-image-xen-686', 'xen-hypervisor', 'xen-tools', 'xen-utils' ], + 'Ubuntu' => [ 'python-vm-builder', 'ubuntu-xen-server', 'libvirt-ruby' ], + 'Fedora' => [ 'kernel-xen', 'xen', 'ruby-libvirt' ], } } default: { From d6da6056bbee0b64779b4f335b2c2a2794425c83 Mon Sep 17 00:00:00 2001 From: "Paulo E. Castro" Date: Wed, 16 Oct 2013 12:10:51 +0100 Subject: [PATCH 3/4] Allow a boot_order parameter --- lib/puppet/provider/virt/libvirt.rb | 6 ++++-- lib/puppet/type/virt.rb | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/puppet/provider/virt/libvirt.rb b/lib/puppet/provider/virt/libvirt.rb index 233f955..9d2d2d6 100644 --- a/lib/puppet/provider/virt/libvirt.rb +++ b/lib/puppet/provider/virt/libvirt.rb @@ -134,8 +134,10 @@ def diskargs def bootargs debug "Bootargs" - # kickstart support - resource[:kickstart] ? ["-x", resource[:kickstart]] : [] + bootargs = [] + bootargs = ["-x", resource[:kickstart]] if resource[:kickstart] #kickstart support + bootargs << ["--boot",resource[:boot_order]] if resource[:boot_order] + bootargs end # Creates network arguments for virt-install command diff --git a/lib/puppet/type/virt.rb b/lib/puppet/type/virt.rb index 234e61d..a4f3591 100644 --- a/lib/puppet/type/virt.rb +++ b/lib/puppet/type/virt.rb @@ -688,6 +688,10 @@ def insync?(current) end end + newparam(:boot_order) do + desc "Specify the boot order of the machine." + end + ### # UBC parameters (in form of barrier:limit) # Requires one or two arguments. In case of one argument, vzctl sets barrier and limit to the same value. In case of two colon-separated arguments, the first is a barrier, and the second is a limit. Each argument is either a number, a number with a suffix, or the special value 'unlimited'." From 9595594ea6043710a094ee1e107576ef275425b9 Mon Sep 17 00:00:00 2001 From: "Paulo E. Castro" Date: Tue, 7 Oct 2014 18:47:26 +0100 Subject: [PATCH 4/4] Boot order example. --- examples/kvm.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/kvm.pp b/examples/kvm.pp index 7aab8bb..b0bcd8b 100644 --- a/examples/kvm.pp +++ b/examples/kvm.pp @@ -7,7 +7,8 @@ virt_path => '/home/user/disk0.qcow2', cpus => 2, ensure => running, - virt_type => 'kvm' + virt_type => 'kvm', + boot_order => 'network,menu=on', } # clone from guest-kvm1