Puppet Class: profile::puppetmaster::backend

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

Overview

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

  • allow_from (Array[String]) (defaults to: lookup('profile::puppetmaster::backend::allow_from'))

    A list of hosts for the allowed from list

  • 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



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
# 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'),
    Array[String]                        $allow_from          = lookup('profile::puppetmaster::backend::allow_from'),
    Optional[String]                     $extra_auth_rules    = lookup('profile::puppetmaster::backend::extra_auth_rules'),
) {

    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',
        config              => $profile::puppetmaster::common::config,
        secure_private      => $secure_private,
        prevent_cherrypicks => $prevent_cherrypicks,
        allow_from          => $allow_from,
        extra_auth_rules    => $extra_auth_rules,
        netbox_hiera_enable => $profile::puppetmaster::common::netbox_hiera_enable,
        ca_server           => $ca_server,
        servers             => $servers,
    }

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