Puppet Class: install_server::preseed_server

Defined in:
modules/install_server/manifests/preseed_server.pp

Overview

Parameters:

  • preseed_subnets (Hash[String[1], Install_server::Preseed_subnet::Config]) (defaults to: {})
  • preseed_per_hostname (Hash[String[1], Array[Install_server::Preseed_host::Config]]) (defaults to: {})


15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'modules/install_server/manifests/preseed_server.pp', line 15

class install_server::preseed_server (
  Hash[String[1], Install_server::Preseed_subnet::Config] $preseed_subnets = {},
  Hash[String[1], Array[Install_server::Preseed_host::Config]] $preseed_per_hostname = {},

) {
  file { '/srv/autoinstall':
    ensure  => directory,
    mode    => '0444',
    source  => 'puppet:///modules/install_server/autoinstall',
    recurse => true,
    purge   => true,
  }

  file { '/srv/autoinstall/subnets':
    ensure => directory,
    mode   => '0444',
  }

  $preseed_subnets.each |$subnet_name, $subnet_config| {
    file { "/srv/autoinstall/subnets/${subnet_name}.cfg":
      ensure  => file,
      mode    => '0444',
      content => template('install_server/autoinstall_subnet.cfg.erb'),
    }
  }

  $preseed_per_gateway = Hash(
    $preseed_subnets.map |$subnet_name, $subnet_config| {
      [$subnet_config['subnet_gateway'], "subnets/${subnet_name}.cfg"]
    }
  )
  file { '/srv/autoinstall/netboot.cfg':
    ensure  => file,
    mode    => '0444',
    content => template('install_server/netboot.cfg.erb'),
  }

  file { '/srv/autoinstall/preseed.cfg':
    ensure => link,
    target => '/srv/autoinstall/netboot.cfg',
  }
}