* Some installation's instructions only run if running a PVE kernel (test the new is_pve_kernel fact).

This commit is contained in:
gardouille 2015-04-17 14:30:25 +02:00
parent 8cd1a0e39a
commit 3c5e199e8c
2 changed files with 31 additions and 27 deletions

View File

@ -7,6 +7,7 @@
* New fact is_pve_kernel check if the running kernel is a PVE.
##### Changes
* Some installation's instructions only run if running a PVE kernel (test the new is_pve_kernel fact).
##### Bugfixes

View File

@ -9,33 +9,8 @@ class proxmox::hypervisor::install {
logoutput => 'on_failure',
}
# If the system run on a standard Debian Kernel
if $::kernelrelease == '3.2.0-4-amd64' {
# To avoid unwanted reboot (kernel update for example), the PVE kernel is
# installed only if the system run on a standard Debian.
# You will need to update your PVE kernel manually.
# Installation of the PVE Kernel
if $proxmox::hypervisor::kvm_only == true {
notify { "Need to install a PVE kernel (${proxmox::hypervisor::kernel_kvm_pkg_name}) and reboot the system to run it ...": }
->
package { $proxmox::hypervisor::kernel_kvm_pkg_name:
ensure => $proxmox::hypervisor::ve_pkg_ensure,
notify => Exec['update_grub','reboot_to_pve'],
}
}
else {
notify { "Need to install a PVE kernel (${proxmox::hypervisor::kernel_pkg_name}) and reboot the system to run it ...": }
->
package { $proxmox::hypervisor::kernel_pkg_name:
ensure => $proxmox::hypervisor::ve_pkg_ensure,
notify => Exec['update_grub','grub_reboot'],
}
# The kernel that allow KVM + OpenVZ is older than the standard Debian's
# kernel, so grub reboot must be used
}
}
else { # If the system already run a PVE kernel
# If the system already run a PVE kernel
if $::is_pve_kernel == 'true' {
# Installation of Virtual Environnment
package { $proxmox::hypervisor::ve_pkg_name:
@ -60,6 +35,34 @@ class proxmox::hypervisor::install {
}
}
else { # If the system run on a standard Debian Kernel
# To avoid unwanted reboot (kernel update for example), the PVE kernel is
# installed only if the system run on a standard Debian.
# You will need to update your PVE kernel manually.
# Installation of the PVE Kernel
if $proxmox::hypervisor::kvm_only == true {
notify { "Need to REBOOT the system on the new PVE kernel (${proxmox::hypervisor::kernel_kvm_pkg_name}) ...": }
->
package { $proxmox::hypervisor::kernel_kvm_pkg_name:
ensure => $proxmox::hypervisor::ve_pkg_ensure,
notify => Exec['update_grub','reboot_to_pve'],
}
}
else {
notify { "Need to REBOOT the system on the new PVE kernel (${proxmox::hypervisor::kernel_pkg_name}) ...": }
->
package { $proxmox::hypervisor::kernel_pkg_name:
ensure => $proxmox::hypervisor::ve_pkg_ensure,
notify => Exec['update_grub','grub_reboot'],
}
# The kernel that allow KVM + OpenVZ is older than the standard Debian's
# kernel, so grub reboot must be used
}
}
# Ensure the grub is update
exec { 'update_grub':