Puppet Class: puppet::server::bootstrap::globals

Defined in:
manifests/server/bootstrap/globals.pp

Summary

Global bootstrap parameters

Overview

Defines parameters used globally during the bootstrap process

Examples:

include puppet::server::bootstrap::globals

Parameters:

  • bootstrap_path (Stdlib::Unixpath) (defaults to: '/root/bootstrap')

    Specifies the path to the bootstrap files. This path is predefined as ‘/root/bootstrap`. It serves as the default location for all necessary bootstrap files and scripts.

  • cwd (Optional[Stdlib::Unixpath]) (defaults to: $bootstrap_path)

    Defines the working directory for executing the r10k command and other related bootstrap commands. By default, this is set to the same path as ‘bootstrap_path`, ensuring a centralized location for running bootstrap operations.

  • access_data (Array[ Struct[{ name => Stdlib::Fqdn, key_data => String, key_prefix => String, Optional[server] => Stdlib::Fqdn, Optional[sshkey_type] => Openssh::KeyID, Optional[ssh_options] => Openssh::SshConfig, }] ]) (defaults to: [])
  • ssh_config (Array[Openssh::SshConfig]) (defaults to: [])


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
# File 'manifests/server/bootstrap/globals.pp', line 16

class puppet::server::bootstrap::globals (
  Array[
    Struct[{
        name                  => Stdlib::Fqdn,
        key_data              => String,
        key_prefix            => String,
        Optional[server]      => Stdlib::Fqdn,
        Optional[sshkey_type] => Openssh::KeyID,
        Optional[ssh_options] => Openssh::SshConfig,
    }]
  ] $access_data = [],
  Array[Openssh::SshConfig] $ssh_config = [],
  Stdlib::Unixpath $bootstrap_path = '/root/bootstrap',
  Optional[Stdlib::Unixpath] $cwd = $bootstrap_path,
) {
  $ssh_access_config = $access_data.reduce([]) |$memo, $creds| {
    $key_name    = $creds['name']

    $server      = $creds['server'] ? {
      String  => $creds['server'],
      default => downcase($key_name)
    }

    $key_prefix  = $creds['key_prefix']

    $sshkey_type = $creds['sshkey_type'] ? {
      String  => $creds['sshkey_type'],
      default => 'ed25519'
    }

    $config      = {
      'Host'                  => $server,
      'StrictHostKeyChecking' => 'no',
      'IdentityFile'          => "~/.ssh/${key_prefix}.id_${sshkey_type}",
    } + $creds['ssh_options']

    $memo + [$config]
  }
}