# profiles::proxmox::install class profiles::proxmox::install { # include params class include profiles::proxmox::params # install the pve kernel package { 'proxmox-default-kernel': ensure => $profiles::proxmox::params::pve_kernel_version, notify => Reboot['after_run'], require => Apt::Source['proxmox'], } # reboot into the new kernel reboot { 'after_run': apply => finished, } if $facts['kernelrelease'] == $profiles::proxmox::params::pve_kernel_release { # install pve ensure_packages($profiles::proxmox::params::pve_packages_install, { ensure => 'present', require => Apt::Source['proxmox']}) # remove the old linux kernel metapackage ensure_packages($profiles::proxmox::params::pve_packages_remove, { ensure => 'absent' }) # install ceph package if requested if $profiles::proxmox::params::pve_ceph_install { ensure_packages($profiles::proxmox::params::pve_packages_ceph, { ensure => 'present', require => Apt::Source['ceph'] }) } # cleanup the old kernel packages exec { 'remove-linux-kernel-packages': command => '/usr/bin/apt-get purge -y $(/usr/bin/dpkg --list | /bin/grep "linux-image-6.1" | /usr/bin/awk \'{ print $2 }\')', onlyif => '/usr/bin/dpkg --list | /bin/grep -q "linux-image-6.1"', path => ['/usr/bin', '/bin', '/sbin'], refreshonly => true, } # update grup exec { 'update-grub': command => '/usr/sbin/update-grub', path => ['/usr/bin', '/bin', '/sbin'], refreshonly => true, } # update grub after removing kernel packages only Exec['remove-linux-kernel-packages'] ~> Exec['update-grub'] # prepare for SDN file_line { 'source-network-interfaces-d': path => '/etc/network/interfaces', line => 'source /etc/network/interfaces.d/*', match => '^source /etc/network/interfaces.d/\*$', append_on_no_match => true, } } }