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 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/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 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'." 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: {