diff --git a/lib/facter/is_proxmox.rb b/lib/facter/is_proxmox.rb new file mode 100644 index 0000000..53ee880 --- /dev/null +++ b/lib/facter/is_proxmox.rb @@ -0,0 +1,7 @@ +#is_proxmox.rb + +Facter.add("is_proxmox") do + setcode do + FileTest.exists?("/etc/pve/") + end +end diff --git a/manifests/hypervisor.pp b/manifests/hypervisor.pp index 164b9f0..164b299 100644 --- a/manifests/hypervisor.pp +++ b/manifests/hypervisor.pp @@ -48,11 +48,10 @@ class proxmox::hypervisor ( include '::proxmox::hypervisor::preconfig' include '::proxmox::hypervisor::install' -# include '::proxmox::hypervisor::config' + include '::proxmox::hypervisor::config' Class['proxmox::hypervisor::preconfig'] -> - Class['proxmox::hypervisor::install'] -# Class['proxmox::hypervisor::install'] -> -# Class['proxmox::hypervisor::config'] + Class['proxmox::hypervisor::install'] -> + Class['proxmox::hypervisor::config'] } # Public class: proxmox::hypervisor diff --git a/manifests/hypervisor/config.pp b/manifests/hypervisor/config.pp new file mode 100644 index 0000000..2efdc2c --- /dev/null +++ b/manifests/hypervisor/config.pp @@ -0,0 +1,23 @@ +# == Class: proxmox::hypervisor::config +# +# Some tiny configurations for Proxmox +# +class proxmox::hypervisor::config { + + Exec { + path => [ '/bin', '/sbin', '/usr/bin', '/usr/sbin' ], + logoutput => 'on_failure', + } + + + if $::is_proxmox == 'true' { + + # Remove the Subscription message + exec { 'remove_subscription_message': + command => 'rm -f /usr/share/pve-manager/ext4/pvemanagerlib.js.bak; sed -i".bak" -r -e "s/if \(data.status !== \'Active\'\) \{/if (false) {/" /usr/share/pve-manager/ext4/pvemanagerlib.js', + onlyif => 'grep "if (data.status !== \'Active\') {" /usr/share/pve-manager/ext4/pvemanagerlib.js', + } + + } + +} # Private class: proxmox::hypervisor::config