* (#2) Add an array and a file to load additionnal module.
This commit is contained in:
parent
d1622e2d38
commit
f9f5aa6f2e
|
@ -3,6 +3,7 @@
|
||||||
##### Changes
|
##### Changes
|
||||||
* Add examples in README.md file.
|
* Add examples in README.md file.
|
||||||
* Correct indentation, double quote, ...
|
* Correct indentation, double quote, ...
|
||||||
|
* (#2) Add an array and a file to load additionnal module.
|
||||||
|
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,9 @@ class proxmox::hypervisor (
|
||||||
$pveproxy_service_name = $proxmox::params::pveproxy_service_name,
|
$pveproxy_service_name = $proxmox::params::pveproxy_service_name,
|
||||||
$pveproxy_service_manage = $proxmox::params::pveproxy_service_manage,
|
$pveproxy_service_manage = $proxmox::params::pveproxy_service_manage,
|
||||||
$pveproxy_service_enabled = $proxmox::params::pveproxy_service_enabled,
|
$pveproxy_service_enabled = $proxmox::params::pveproxy_service_enabled,
|
||||||
|
$pve_modules_list = $proxmox::params::pve_modules_list,
|
||||||
|
$pve_modules_file_path = $proxmox::params::pve_modules_file_path,
|
||||||
|
$pve_modules_file_content = $proxmox::params::pve_modules_file_content,
|
||||||
) inherits proxmox::params {
|
) inherits proxmox::params {
|
||||||
|
|
||||||
include '::proxmox::hypervisor::preconfig'
|
include '::proxmox::hypervisor::preconfig'
|
||||||
|
|
|
@ -12,18 +12,18 @@ class proxmox::hypervisor::preconfig {
|
||||||
|
|
||||||
# Hostname should be resolvable via /etc/hosts
|
# Hostname should be resolvable via /etc/hosts
|
||||||
#/files/etc/hosts/2
|
#/files/etc/hosts/2
|
||||||
#/files/etc/hosts/2/ipaddr = "214.938.839.123"
|
#/files/etc/hosts/2/ipaddr = '214.938.839.123'
|
||||||
#/files/etc/hosts/2/canonical = "hypervisor.domain.tld"
|
#/files/etc/hosts/2/canonical = 'hypervisor.domain.tld'
|
||||||
#/files/etc/hosts/2/alias[1] = "hypervisor"
|
#/files/etc/hosts/2/alias[1] = 'hypervisor'
|
||||||
#/files/etc/hosts/1/ipaddr = "127.0.0.1"
|
#/files/etc/hosts/1/ipaddr = '127.0.0.1'
|
||||||
#/files/etc/hosts/1/canonical = "localhost"
|
#/files/etc/hosts/1/canonical = 'localhost'
|
||||||
augeas { "${::fqdn}":
|
augeas { "${::fqdn}":
|
||||||
context => "/files/etc/hosts",
|
context => '/files/etc/hosts',
|
||||||
changes => [
|
changes => [
|
||||||
#"ins ipaddr ${::ipaddress}",
|
#"ins ipaddr ${::ipaddress}",
|
||||||
"set 02/ipaddr ${::ipaddress}",
|
"set 02/ipaddr ${::ipaddress}",
|
||||||
"set *[ipaddr = '${::ipaddress}']/canonical ${::fqdn}",
|
"set *[ipaddr = '${::ipaddress}']/canonical ${::fqdn}",
|
||||||
"set *[ipaddr = '${::ipaddress}']/alias[1] $hostname",
|
"set *[ipaddr = '${::ipaddress}']/alias[1] ${::hostname}",
|
||||||
"set *[ipaddr = '127.0.0.1']/canonical localhost",
|
"set *[ipaddr = '127.0.0.1']/canonical localhost",
|
||||||
"rm *[ipaddr = '127.0.1.1']",
|
"rm *[ipaddr = '127.0.1.1']",
|
||||||
],
|
],
|
||||||
|
@ -49,7 +49,7 @@ class proxmox::hypervisor::preconfig {
|
||||||
|
|
||||||
# Set the grub default to saved to be able to use grub-set-default during
|
# Set the grub default to saved to be able to use grub-set-default during
|
||||||
# the installation
|
# the installation
|
||||||
if ! defined(Augeas["grub_default"]) {
|
if ! defined(Augeas['grub_default']) {
|
||||||
augeas { 'grub_default':
|
augeas { 'grub_default':
|
||||||
context => '/files/etc/default/grub',
|
context => '/files/etc/default/grub',
|
||||||
changes => [
|
changes => [
|
||||||
|
@ -58,5 +58,18 @@ class proxmox::hypervisor::preconfig {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ! defined(File['/etc/modules-load.d']) {
|
||||||
|
file { '/etc/modules-load.d':
|
||||||
|
ensure => directory,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$values = [ 'v1', 'v2' ]
|
||||||
|
|
||||||
|
file { "${proxmox::hypervisor::pve_modules_file_path}":
|
||||||
|
ensure => present,
|
||||||
|
content => template("${proxmox::hypervisor::pve_modules_file_content}"),
|
||||||
|
require => File['/etc/modules-load.d'],
|
||||||
|
}
|
||||||
|
|
||||||
} # Private class: proxmox::hypervisor::preconfig
|
} # Private class: proxmox::hypervisor::preconfig
|
||||||
|
|
|
@ -20,7 +20,7 @@ class proxmox::params {
|
||||||
$old_pkg_ensure = 'absent'
|
$old_pkg_ensure = 'absent'
|
||||||
$old_pkg_name = [ 'acpid', 'linux-image-amd64', 'linux-base', 'linux-image-3.2.0-4-amd64' ]
|
$old_pkg_name = [ 'acpid', 'linux-image-amd64', 'linux-base', 'linux-image-3.2.0-4-amd64' ]
|
||||||
|
|
||||||
#
|
# Manage PVE Enterprise repository (need a subscription)
|
||||||
$pve_enterprise_repo_ensure = 'absent'
|
$pve_enterprise_repo_ensure = 'absent'
|
||||||
|
|
||||||
# Pveproxy access restriction
|
# Pveproxy access restriction
|
||||||
|
@ -30,8 +30,14 @@ class proxmox::params {
|
||||||
$pveproxy_deny = 'all'
|
$pveproxy_deny = 'all'
|
||||||
$pveproxy_policy = 'allow'
|
$pveproxy_policy = 'allow'
|
||||||
$pveproxy_service_name = 'pveproxy'
|
$pveproxy_service_name = 'pveproxy'
|
||||||
$pveproxy_service_manage = true
|
$pveproxy_service_manage = true
|
||||||
$pveproxy_service_enabled = true
|
$pveproxy_service_enabled = true
|
||||||
|
|
||||||
|
# Manage additionnals modules
|
||||||
|
$pve_modules_list = [ 'xt_iprange', 'xt_comment' ]
|
||||||
|
$pve_modules_file_path = '/etc/modules-load.d/proxmox.conf'
|
||||||
|
$pve_modules_file_content = 'proxmox/hypervisor/proxmox_modules.conf.erb'
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
#file generated by puppet
|
||||||
|
#Don't edit, please see https://forge.puppetlabs.com/gardouille/proxmox
|
||||||
|
|
||||||
|
## Load additonnal modules for Proxmox
|
||||||
|
<% @pve_modules_list.each do |val| -%>
|
||||||
|
<%= val %>
|
||||||
|
<% end -%>
|
Loading…
Reference in New Issue