* Add vz service management.

This commit is contained in:
gardouille 2015-02-03 16:16:36 +01:00
parent 1a593c678f
commit 71312b261f
4 changed files with 23 additions and 0 deletions

View File

@ -4,6 +4,7 @@
##### Features
* Manage the main OpenVZ's configuration file (/etc/vz/vz.conf).
* Add vz service management.
##### Changes
* The network management for an OpenVZ CT now works for all Debian family and not only Debian >=7.

View File

@ -58,6 +58,9 @@ class proxmox::hypervisor (
$pve_modules_file_content = $proxmox::params::pve_modules_file_content,
$vz_config_file_path = $proxmox::params::vz_config_file_path,
$vz_config_file_tpl = $proxmox::params::vz_config_file_tpl,
$vz_service_name = $proxmox::params::vz_service_name,
$vz_service_manage = $proxmox::params::vz_service_manage,
$vz_service_enabled = $proxmox::params::vz_service_enabled,
$labs_firewall_rule = $proxmox::params::labs_firewall_rule,
) inherits proxmox::params {

View File

@ -11,6 +11,13 @@ class proxmox::hypervisor::service {
$pveproxy_service_ensure = 'stopped'
}
if $proxmox::hypervisor::vz_service_enabled == true {
$vz_service_ensure = 'running'
} else {
$vz_service_ensure = 'stopped'
}
if $::is_proxmox == 'true' {
if $proxmox::hypervisor::pveproxy_service_manage == true {
@ -22,6 +29,15 @@ class proxmox::hypervisor::service {
}
}
if $proxmox::hypervisor::vz_service_manage == true {
service { "${proxmox::hypervisor::vz_service_name}":
ensure => "${vz_service_ensure}",
enable => "${proxmox::hypervisor::pveproxy_service_enabled}",
hasstatus => true,
hasrestart => true,
}
}
}

View File

@ -41,6 +41,9 @@ class proxmox::params {
# OpenVZ configuration
$vz_config_file_path = '/etc/vz/vz.conf'
$vz_config_file_tpl = 'proxmox/hypervisor/vz.conf.erb'
$vz_service_name = 'vz'
$vz_service_manage = true
$vz_service_enabled = true
# Firewall
$labs_firewall_rule = false