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:
parent
7bb8b60d3c
commit
add74a6e37
7
lib/facter/is_proxmox.rb
Normal file
7
lib/facter/is_proxmox.rb
Normal file
@ -0,0 +1,7 @@
|
||||
#is_proxmox.rb
|
||||
|
||||
Facter.add("is_proxmox") do
|
||||
setcode do
|
||||
FileTest.exists?("/etc/pve/")
|
||||
end
|
||||
end
|
@ -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
|
||||
|
23
manifests/hypervisor/config.pp
Normal file
23
manifests/hypervisor/config.pp
Normal 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
|
Loading…
Reference in New Issue
Block a user