Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boot params #30

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/kvm.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions lib/puppet/provider/virt/libvirt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/virt/openvz.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions lib/puppet/type/virt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'."
Expand Down
18 changes: 9 additions & 9 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down