Puppet Class: profile::puppet_compiler

Defined in:
modules/profile/manifests/puppet_compiler.pp

Overview

Parameters:

  • puppetdb_proxy (Boolean) (defaults to: lookup('profile::puppet_compiler::puppetdb_proxy'))
  • puppetdb_host (Optional[Stdlib::Host]) (defaults to: lookup('profile::puppet_compiler::puppetdb_host'))
  • puppetdb_port (Optional[Stdlib::Port]) (defaults to: lookup('profile::puppet_compiler::puppetdb_port'))


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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'modules/profile/manifests/puppet_compiler.pp', line 2

class profile::puppet_compiler (
    Boolean                $puppetdb_proxy = lookup('profile::puppet_compiler::puppetdb_proxy'),
    Optional[Stdlib::Host] $puppetdb_host  = lookup('profile::puppet_compiler::puppetdb_host'),
    Optional[Stdlib::Port] $puppetdb_port  = lookup('profile::puppet_compiler::puppetdb_port'),
) {
    requires_realm('labs')

    include profile::openstack::base::puppetmaster::enc_client
    class {'puppet_compiler': }
    class { 'puppetmaster::puppetdb::client':
        hosts => [$facts['fqdn']],
    }
    # puppetdb configuration
    file { "${puppet_compiler::vardir}/puppetdb.conf":
        source => '/etc/puppet/puppetdb.conf',
        owner  => $puppet_compiler::user,
    }
    ferm::service {'puppet_compiler_web':
        proto  => 'tcp',
        port   => 'http',
        prio   => '30',
        # TODO: could restrict this to just the db1001 and localhost
        srange => '$LABS_NETWORKS'
    }
    if $puppetdb_proxy {
        $ssldir = "${puppet_compiler::vardir}/ssl"
        $ssl_settings = ssl_ciphersuite('nginx', 'strong')
        $docroot = $puppet_compiler::workdir

        nginx::site {'puppet-compiler':
            content => template('profile/puppet_compiler/puppetdb-proxy.erb'),
        }
        ferm::service {'puppetdb-proxy':
            proto  => 'tcp',
            port   => 'https',
            prio   => '30',
            srange => '$LABS_NETWORKS'
        }
    } else {
        nginx::site {'puppet-compiler':
          content => template('profile/puppet_compiler/nginx_site.erb'),
        }
    }
    file_line { 'modify_nginx_magic_types':
        path    => '/etc/nginx/mime.types',
        line    => "    text/plain                            txt pson err diff;",
        match   => '\s+text/plain\s+txt',
        require => Nginx::Site['puppet-compiler'],
        notify  => Service['nginx'],
    }
}