Puppet Plan: puppet::bootstrap

Defined in:
plans/bootstrap.pp

Overview

Parameters:

  • targets (TargetSpec)
  • server (Stdlib::Fqdn)
  • certname (Optional[String]) (defaults to: undef)
  • collection (Puppet::Platform) (defaults to: 'puppet8')


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
# File 'plans/bootstrap.pp', line 1

plan puppet::bootstrap (
  TargetSpec $targets,
  Stdlib::Fqdn $server,
  Optional[String] $certname = undef,
  Puppet::Platform $collection = 'puppet8',
) {
  get_targets($targets).each |$target| {
    run_plan(puppet::agent::install, $target, collection => $collection)
    run_plan(facts, $target)

    $apply_results = apply($target) {
      class { 'puppet::globals':
        platform_name => $collection,
      }

      include puppet

      class { 'puppet::agent::config':
        server   => $server,
        certname => $certname,
      }

      class { 'puppet::agent::bootstrap':
        certname => $certname,
        require  => Class['puppet::agent::config'],
      }
    }

    # Print log messages from the report
    $apply_results.each |$result| {
      $result.report['logs'].each |$log| {
        out::message("${log['level'].capitalize}: ${log['source']}: ${log['message']}")
      }
    }
  }
}