Puppet Plan: puppet::server::sync

Defined in:
plans/server/sync.pp

Summary

Sync Puppet manifests on specified Puppet controller nodes

Overview

This Bolt plan runs the r10k command on each Puppet controller node specified in the target. It ensures that the latest manifests are synced.

Parameters:

  • targets (TargetSpec)

    Puppet server(s) where the manifests should be synced.

  • collection (Puppet::Platform) (defaults to: 'puppet8')


9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'plans/server/sync.pp', line 9

plan puppet::server::sync (
  TargetSpec $targets,
  Puppet::Platform $collection = 'puppet8',
) {
  # Gather facts about the target nodes
  run_plan('facts', $targets)

  # Apply the puppet::r10k::run class on each target node
  return apply($targets) {
    include puppet

    class { 'puppet::globals':
      platform_name => $collection,
    }

    class { 'puppet::r10k::run':
      cwd               => '/',
      setup_on_each_run => true,
    }
  }
}