Puppet Plan: puppet::server::bootstrap

Defined in:
plans/server/bootstrap.pp

Overview

Parameters:

  • targets (TargetSpec)
  • collection (Puppet::Platform) (defaults to: 'puppet8')
  • access_data_lookup_key (String) (defaults to: 'puppet::server::bootstrap::access')
  • ssh_config_lookup_key (String) (defaults to: 'puppet::server::bootstrap::ssh_config')
  • bootstrap_path (Stdlib::Unixpath) (defaults to: '/root/bootstrap')
  • use_ssh (Boolean) (defaults to: true)


1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
# File 'plans/server/bootstrap.pp', line 1

plan puppet::server::bootstrap (
  TargetSpec $targets,
  Puppet::Platform $collection = 'puppet8',
  String $access_data_lookup_key = 'puppet::server::bootstrap::access',
  String $ssh_config_lookup_key = 'puppet::server::bootstrap::ssh_config',
  Stdlib::Unixpath $bootstrap_path = '/root/bootstrap',
  Boolean $use_ssh = true,
) {
  run_plan(facts, $targets)

  return apply($targets) {
    include puppet

    $access_data = lookup({
        name => $access_data_lookup_key,
        value_type => Array[
          Struct[{
              name                  => String,
              key_data              => String,
              key_prefix            => String,
              Optional[server]      => String,
              Optional[sshkey_type] => String,
              Optional[ssh_options] => Hash[String, Variant[String, Integer, Array[String]]],
          }]
        ],
        default_value => [],
    })

    $ssh_config = lookup({
        name => $ssh_config_lookup_key,
        value_type => Array[
          Hash[String, Variant[String, Integer, Array[String]]]
        ],
        default_value => [],
    })

    class { 'puppet::server::bootstrap::globals':
      access_data    => $access_data,
      ssh_config     => $ssh_config,
      bootstrap_path => $bootstrap_path,
    }

    class { 'puppet::server::bootstrap':
      platform_name    => $collection,
      # set it to 'production' because Bolt catalog's default is 'bolt_catalog'
      node_environment => 'production',
      use_ssh          => $use_ssh,
    }
  }
}