2015-12-10 10:09:02 +01:00
|
|
|
# == Class: proxmox4::hypervisor::config
|
2015-12-10 10:03:08 +01:00
|
|
|
#
|
|
|
|
# Some tiny configurations for Proxmox
|
|
|
|
#
|
2015-12-10 10:09:02 +01:00
|
|
|
class proxmox4::hypervisor::config {
|
2015-12-10 10:03:08 +01:00
|
|
|
|
|
|
|
File {
|
|
|
|
owner => root,
|
|
|
|
group => root,
|
|
|
|
mode => 644,
|
|
|
|
}
|
|
|
|
|
|
|
|
Exec {
|
|
|
|
path => [ '/bin', '/sbin', '/usr/bin', '/usr/sbin' ],
|
|
|
|
logoutput => 'on_failure',
|
|
|
|
}
|
|
|
|
|
|
|
|
## Quoted boolean value because can't return "true" boolean with personal fact
|
|
|
|
if $::is_proxmox == 'true' {
|
|
|
|
|
|
|
|
# Pveproxy access control list
|
2015-12-10 10:09:02 +01:00
|
|
|
file { $proxmox4::hypervisor::pveproxy_default_path:
|
2015-12-10 10:03:08 +01:00
|
|
|
ensure => present,
|
2015-12-10 10:09:02 +01:00
|
|
|
content => template($proxmox4::hypervisor::pveproxy_default_content),
|
|
|
|
notify => Service[$proxmox4::hypervisor::pveproxy_service_name],
|
2015-12-10 10:03:08 +01:00
|
|
|
}
|
|
|
|
->
|
|
|
|
|
|
|
|
# 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',
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-12-10 10:09:02 +01:00
|
|
|
if $proxmox4::hypervisor::labs_firewall_rule == true {
|
2015-12-10 10:03:08 +01:00
|
|
|
|
|
|
|
firewall { '100 accept proxmox':
|
|
|
|
proto => 'tcp',
|
|
|
|
action => 'accept',
|
|
|
|
port => ['8006', '5900']
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-12-10 10:09:02 +01:00
|
|
|
} # Private class: proxmox4::hypervisor::config
|