New class: proxmox::hypervisor::config

Remove the subscription message at the login on the webgui.
Add a fact to check if Proxmox is available on the system.
This commit is contained in:
gardouille 2015-01-08 23:50:53 +01:00
parent 7bb8b60d3c
commit add74a6e37
3 changed files with 33 additions and 4 deletions

7
lib/facter/is_proxmox.rb Normal file
View File

@ -0,0 +1,7 @@
#is_proxmox.rb
Facter.add("is_proxmox") do
setcode do
FileTest.exists?("/etc/pve/")
end
end

View File

@ -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

View File

@ -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