Puppet Class: puppet::server

Inherits:
puppet::params
Defined in:
manifests/server.pp

Overview

Class: puppet::server

This class installs and configures a Puppet master

Description

This class implements a Puppet master based around the dynamic environments workflow descripted in puppetlabs.com/blog/git-workflow-and-puppet-environments/

Parameters

  • modulepath

  • storeconfigs

  • dbadapter

  • dbuser

  • dbpassword

  • dbserver

  • dbsocket

  • servertype

Example

Sample Usage:

$modulepath = [
  "/etc/puppet/modules/site",
  "/etc/puppet/modules/dist",
]

class { "puppet::server":
  modulepath => inline_template("<%= modulepath.join(':') %>"),
  reporturl  => "https://dashboard.puppetlabs.com/reports";
}

Parameters:

  • modulepath (Any) (defaults to: ['$confdir/modules/site', '$confdir/env/$environment/dist'])
  • manifest (Any) (defaults to: '$confdir/modules/site/site.pp')
  • config_version_cmd (Any) (defaults to: '/usr/bin/git --git-dir $confdir/environments/$environment/.git rev-parse --short HEAD 2>/dev/null || echo')
  • storeconfigs (Any) (defaults to: undef)
  • report (Any) (defaults to: 'true')
  • reports (Any) (defaults to: ["store", "https"])
  • reporturl (Any) (defaults to: "http://$fqdn/reports")
  • reportfrom (Any) (defaults to: undef)
  • servertype (Any) (defaults to: "unicorn")
  • ca (Any) (defaults to: false)
  • bindaddress (Any) (defaults to: '::')
  • enc (Any) (defaults to: '')
  • enc_exec (Any) (defaults to: '')
  • backup_server (Any) (defaults to: hiera('puppet_server_backup', 'true'))
  • servername (Any) (defaults to: undef)
  • ensure (Any) (defaults to: 'present')
  • parser (Any) (defaults to: undef)
  • gentoo_use (Any) (defaults to: $puppet::params::master_use)
  • gentoo_keywords (Any) (defaults to: $puppet::params::master_keywords)
  • manage_package (Any) (defaults to: true)


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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'manifests/server.pp', line 34

class puppet::server (
  $modulepath         = ['$confdir/modules/site', '$confdir/env/$environment/dist'],
  $manifest           = '$confdir/modules/site/site.pp',
  $config_version_cmd = '/usr/bin/git --git-dir $confdir/environments/$environment/.git rev-parse --short HEAD 2>/dev/null || echo',
  $storeconfigs       = undef,
  $report             = 'true',
  $reports            = ["store", "https"],
  $reporturl          = "http://$fqdn/reports",
  $reportfrom         = undef,
  $servertype         = "unicorn",
  $ca                 = false,
  $bindaddress        = '::',
  $enc                = '',
  $enc_exec           = '',
  $backup_server      = hiera('puppet_server_backup', 'true'),
  $servername         = undef,
  $ensure             = 'present',
  $parser             = undef,
  $gentoo_use         = $puppet::params::master_use,
  $gentoo_keywords    = $puppet::params::master_keywords,
  $manage_package     = true,
) inherits puppet::params {

  $master = true

  include puppet
  include puppet::server::config
  if $manage_package {
    include puppet::package
  }

  # ---
  # The site.pp is set in the puppet.conf, remove site.pp here to avoid confusion.
  # Unless the manifest that was passed in is the default site.pp.
  if ($manifest != "${puppet::params::puppet_confdir}/manifests/site.pp") {
    file { "${puppet::params::puppet_confdir}/manifests/site.pp": ensure => absent; }
  }

  # ---
  # Application-server specific SSL configuration
  case $servertype {
    "passenger": {
      include puppet::server::passenger
      $ssl_client_header        = "SSL_CLIENT_S_DN"
      $ssl_client_verify_header = "SSL_CLIENT_VERIFY"
    }
    "unicorn": {
      include puppet::server::unicorn
      $ssl_client_header        = "HTTP_X_CLIENT_DN"
      $ssl_client_verify_header = "HTTP_X_CLIENT_VERIFY"
    }
    "thin": {
      include puppet::server::thin
      $ssl_client_header        = "HTTP_X_CLIENT_DN"
      $ssl_client_verify_header = "HTTP_X_CLIENT_VERIFY"
    }
    "standalone": {
      include puppet::server::standalone
    }
    default: {
      err('Only "passenger", "thin", and "unicorn" are valid options for servertype')
      fail("Servertype \"$servertype\" not implemented")
    }
  }

  # ---
  # Storeconfigs
  if $storeconfigs {
    class { "puppet::storeconfig":
      backend => $storeconfigs,
    }
  }

  # ---
  # Backups
  #
  # FIXME
  # http://projects.puppetlabs.com/issues/10590
  # err: Could not retrieve catalog from remote server: Error 400 on SERVER: can't clone TrueClass
  #
  # Use a real boolean after hiera 1.0 is out
  #
  if $backup_server  == 'true' { include puppet::server::backup }
}