2015-01-07 11:51:34 +01:00
|
|
|
# == Class: proxmox::hypervisor::preconfig
|
|
|
|
#
|
|
|
|
# Before installing Proxmox some modifications have to be applied on the system
|
|
|
|
#
|
|
|
|
class proxmox::hypervisor::preconfig {
|
|
|
|
|
|
|
|
File {
|
|
|
|
owner => root,
|
|
|
|
group => root,
|
|
|
|
mode => 644,
|
|
|
|
}
|
|
|
|
|
|
|
|
# Hostname should be resolvable via /etc/hosts
|
|
|
|
#/files/etc/hosts/2
|
|
|
|
#/files/etc/hosts/2/ipaddr = "214.938.839.123"
|
|
|
|
#/files/etc/hosts/2/canonical = "hypervisor.domain.tld"
|
|
|
|
#/files/etc/hosts/2/alias[1] = "hypervisor"
|
|
|
|
#/files/etc/hosts/1/ipaddr = "127.0.0.1"
|
|
|
|
#/files/etc/hosts/1/canonical = "localhost"
|
|
|
|
augeas { "${::fqdn}":
|
|
|
|
context => "/files/etc/hosts",
|
|
|
|
changes => [
|
|
|
|
#"ins ipaddr ${::ipaddress}",
|
|
|
|
"set 02/ipaddr ${::ipaddress}",
|
|
|
|
"set *[ipaddr = '${::ipaddress}']/canonical ${::fqdn}",
|
|
|
|
"set *[ipaddr = '${::ipaddress}']/alias[1] $hostname",
|
|
|
|
"set *[ipaddr = '127.0.0.1']/canonical localhost",
|
|
|
|
"rm *[ipaddr = '127.0.1.1']",
|
|
|
|
],
|
2015-01-09 00:30:15 +01:00
|
|
|
onlyif => "match *[ipaddr = '${::ipaddress}'] size == 0",
|
2015-01-07 11:51:34 +01:00
|
|
|
}
|
|
|
|
->
|
|
|
|
# Remove Enterprise repository (need a subscription)
|
|
|
|
file { '/etc/apt/sources.list.d/pve-enterprise.list':
|
2015-01-09 09:50:01 +01:00
|
|
|
ensure => "${proxmox::hypervisor::pve_enterprise_repo_ensure}",
|
|
|
|
notify => Exec[apt_update],
|
2015-01-07 11:51:34 +01:00
|
|
|
}
|
|
|
|
->
|
|
|
|
# Add the standard repository (~community)
|
|
|
|
apt::source {'proxmox':
|
|
|
|
ensure => present,
|
|
|
|
location => 'http://download.proxmox.com/debian',
|
|
|
|
release => $::lsbdistcodename,
|
|
|
|
repos => 'pve-no-subscription',
|
|
|
|
include_src => false,
|
|
|
|
key => '9887F95A',
|
|
|
|
key_server => 'keyserver.ubuntu.com',
|
|
|
|
}
|
|
|
|
|
|
|
|
# Set the grub default to saved to be able to use grub-set-default during
|
|
|
|
# the installation
|
|
|
|
if ! defined(Augeas["grub_default"]) {
|
2015-01-09 00:30:15 +01:00
|
|
|
augeas { 'grub_default':
|
|
|
|
context => '/files/etc/default/grub',
|
2015-01-07 11:51:34 +01:00
|
|
|
changes => [
|
2015-01-09 00:30:15 +01:00
|
|
|
'set GRUB_DEFAULT saved',
|
2015-01-07 11:51:34 +01:00
|
|
|
],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} # Private class: proxmox::hypervisor::preconfig
|