From 3c5e199e8c9483e30bff6292440543f2487da3c2 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Fri, 17 Apr 2015 14:30:25 +0200 Subject: [PATCH] * Some installation's instructions only run if running a PVE kernel (test the new is_pve_kernel fact). --- CHANGELOG.md | 1 + manifests/hypervisor/install.pp | 57 +++++++++++++++++---------------- 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1a48e2..312fd00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/manifests/hypervisor/install.pp b/manifests/hypervisor/install.pp index f066b7b..9cf6c6e 100644 --- a/manifests/hypervisor/install.pp +++ b/manifests/hypervisor/install.pp @@ -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':