Puppet Class: puppetmaster::merge_cli

Defined in:
modules/puppetmaster/manifests/merge_cli.pp

Summary

provisions the puppet-merge cli tools used in production to

Overview

SPDX-License-Identifier: Apache-2.0 merge puppet commits

Parameters:

  • servers (Hash[String, Puppetmaster::Backends])
  • ca_server (Stdlib::Host)
  • ensure (Wmflib::Ensure) (defaults to: present)


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
# File 'modules/puppetmaster/manifests/merge_cli.pp', line 4

class puppetmaster::merge_cli (
    Hash[String, Puppetmaster::Backends] $servers,
    Stdlib::Host                         $ca_server,
    Wmflib::Ensure                       $ensure  = present,
) {
    $masters = $servers.keys().filter |$server| { $server != $facts['fqdn'] }
    $workers = $servers.values().map |$worker| {
        $worker.map |$name| { $name['worker'] }.filter |$name| { $name != $facts['fqdn'] }
    }.flatten()
    $puppet_merge_conf = @("CONF")
    # Generated by Puppet
    MASTERS="${masters.join(' ')}"
    WORKERS="${workers.join(' ')}"
    CA_SERVER="${ca_server}"
    | CONF

    file { '/etc/puppet-merge.conf':
        ensure  => stdlib::ensure($ensure, 'file'),
        owner   => 'root',
        group   => 'root',
        mode    => '0555',
        content => $puppet_merge_conf,
    }

    file { '/usr/local/bin/puppet-merge':
        ensure => stdlib::ensure($ensure, 'file'),
        owner  => 'root',
        group  => 'root',
        mode   => '0555',
        source => 'puppet:///modules/puppetmaster/merge_cli/puppet-merge.sh',
    }

    file { '/usr/local/bin/puppet-merge.py':
        ensure => stdlib::ensure($ensure, 'file'),
        owner  => 'root',
        group  => 'root',
        mode   => '0555',
        source => 'puppet:///modules/puppetmaster/merge_cli/puppet-merge.py',
    }
}