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";
}
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 }
}
|