|
|
@ -19,19 +19,17 @@ class proxmox::hypervisor::install { |
|
|
|
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 ...": } |
|
|
|
-> |
|
|
|
# Don't use "${...}" because the kernel_kvm_pkg_name variable is an array |
|
|
|
package { $proxmox::hypervisor::kernel_kvm_pkg_name: |
|
|
|
ensure => "${proxmox::hypervisor::ve_pkg_ensure}", |
|
|
|
notify => Exec['update_grub','reboot_to_pve'], |
|
|
|
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 ...": } |
|
|
|
-> |
|
|
|
# Don't use "${...}" because the kernel_pkg_name variable is an array |
|
|
|
package { $proxmox::hypervisor::kernel_pkg_name: |
|
|
|
ensure => "${proxmox::hypervisor::ve_pkg_ensure}", |
|
|
|
notify => Exec['update_grub','grub_reboot'], |
|
|
|
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 |
|
|
@ -41,12 +39,12 @@ class proxmox::hypervisor::install { |
|
|
|
|
|
|
|
# Installation of Virtual Environnment |
|
|
|
package { $proxmox::hypervisor::ve_pkg_name: |
|
|
|
ensure => "${proxmox::hypervisor::ve_pkg_ensure}", |
|
|
|
ensure => $proxmox::hypervisor::ve_pkg_ensure, |
|
|
|
} -> |
|
|
|
|
|
|
|
# Remove useless packages (such as the standard kernel, acpid, ...) |
|
|
|
package { $proxmox::hypervisor::old_pkg_name: |
|
|
|
ensure => "${proxmox::hypervisor::old_pkg_ensure}", |
|
|
|
ensure => $proxmox::hypervisor::old_pkg_ensure, |
|
|
|
notify => Exec['update_grub'], |
|
|
|
} |
|
|
|
|
|
|
@ -54,30 +52,30 @@ class proxmox::hypervisor::install { |
|
|
|
# come from Proxmox and standard Debian repository |
|
|
|
if ! defined(Package["${proxmox::hypervisor::rec_pkg_name}"]) { |
|
|
|
package { $proxmox::hypervisor::rec_pkg_name: |
|
|
|
ensure => "${proxmox::hypervisor::ve_pkg_ensure}", |
|
|
|
ensure => $proxmox::hypervisor::ve_pkg_ensure, |
|
|
|
} |
|
|
|
} else { |
|
|
|
notice("Warning: cannot manage the installation of ${proxmox::hypervisor::rec_pkg_name}, as another resource (perhaps ...?) is managing it.") |
|
|
|
notice("Warn: can't manage ${proxmox::hypervisor::rec_pkg_name}.") |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
# Ensure the grub is update |
|
|
|
exec { 'update_grub': |
|
|
|
command => "update-grub", |
|
|
|
command => 'update-grub', |
|
|
|
refreshonly => true, |
|
|
|
} |
|
|
|
|
|
|
|
# Choose a different line in the grub |
|
|
|
exec { 'grub_reboot': |
|
|
|
command => "grub-reboot 2", |
|
|
|
command => 'grub-reboot 2', |
|
|
|
refreshonly => true, |
|
|
|
notify => Exec['reboot_to_pve'], |
|
|
|
} |
|
|
|
|
|
|
|
# Reboot on a PVE Kernel |
|
|
|
exec { 'reboot_to_pve': |
|
|
|
command => "shutdown -r 1", |
|
|
|
command => 'shutdown -r 1', |
|
|
|
refreshonly => true, |
|
|
|
} |
|
|
|
|
|
|
|