Puppet Class: profile::puppetmaster::backend

Defined in:
modules/profile/manifests/puppetmaster/backend.pp

Overview

SPDX-License-Identifier: Apache-2.0 vim: set tabstop=4 shiftwidth=4 softtabstop=4 expandtab textwidth=80 smarttab

Parameters:

  • config (Hash) (defaults to: lookup('profile::puppetmaster::backend::config'))

    addtional config to use

  • secure_private (Boolean) (defaults to: lookup('profile::puppetmaster::backend::secure_private'))

    If false, /etc/puppet/private will be labs/private.git. Otherwise, some magic is done to have local repositories and sync between puppetmasters.

  • ca_server (Stdlib::Host) (defaults to: lookup('puppet_ca_server'))

    the CA server

  • prevent_cherrypicks (Boolean) (defaults to: lookup('profile::puppetmaster::backend::prevent_cherrypicks'))

    disable cherry picks

  • extra_auth_rules (Optional[String]) (defaults to: lookup('profile::puppetmaster::backend::extra_auth_rules'))

    Addtional auth rules

  • servers (Hash[String, Puppetmaster::Backends]) (defaults to: lookup('puppetmaster::servers'))

    list of puppetmaster backend servers with wieghts

  • puppetservers (Array[String]) (defaults to: lookup('profile::puppetmaster::backend::puppetservers'))
  • puppet_merge_server (Optional[Stdlib::Host]) (defaults to: lookup('puppet_merge_server'))


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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'modules/profile/manifests/puppetmaster/backend.pp', line 11

class profile::puppetmaster::backend(
    Stdlib::Host                         $ca_server           = lookup('puppet_ca_server'),
    Hash[String, Puppetmaster::Backends] $servers             = lookup('puppetmaster::servers'),
    Hash                                 $config              = lookup('profile::puppetmaster::backend::config'),
    Boolean                              $secure_private      = lookup('profile::puppetmaster::backend::secure_private'),
    Boolean                              $prevent_cherrypicks = lookup('profile::puppetmaster::backend::prevent_cherrypicks'),
    Optional[String]                     $extra_auth_rules    = lookup('profile::puppetmaster::backend::extra_auth_rules'),
    Array[String] $puppetservers                         = lookup('profile::puppetmaster::backend::puppetservers'),
    Optional[Stdlib::Host]               $puppet_merge_server = lookup('puppet_merge_server'),
) {

    ensure_packages(['libapache2-mod-passenger'])

    $common_config = {
        'ca'              => false,
        'ca_server'       => $ca_server,
        'stringify_facts' => false,
    }
    $base_config = merge($config, $common_config)

    class { 'profile::puppetmaster::common':
        base_config => $base_config,
    }

    class { 'httpd':
        remove_default_ports => true,
        modules              => ['passenger'],
    }

    class { 'puppetmaster':
        server_type         => 'backend',
        hiera_config        => $profile::puppetmaster::common::hiera_config,
        config              => $profile::puppetmaster::common::config,
        secure_private      => $secure_private,
        prevent_cherrypicks => $prevent_cherrypicks,
        extra_auth_rules    => $extra_auth_rules,
        netbox_hiera_enable => $profile::puppetmaster::common::netbox_hiera_enable,
        enable_merge_cli    => $profile::puppetmaster::common::enable_merge_cli,
        ca_server           => $ca_server,
        servers             => $servers,
        puppet_merge_server => $puppet_merge_server,
    }

    $puppetservers_puppetmasters_ferm = join($puppetservers + keys($servers), ' ')
    ferm::service { 'ssh_puppet_merge':
        proto  => 'tcp',
        port   => '22',
        srange => "(@resolve((${puppetservers_puppetmasters_ferm})))",
    }
    ferm::service { 'puppetmaster-backend':
        proto  => 'tcp',
        port   => 8141,
        srange => $servers.keys,
    }
    include profile::conftool::client
}