Puppet Class: puppet::profile::server
- Inherits:
- puppet::params
- Defined in:
- manifests/profile/server.pp
Summary
Puppet server installationOverview
Puppet single host installation (Puppet Agent/Server/PuppetDB)
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 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
# File 'manifests/profile/server.pp', line 73
class puppet::profile::server (
Boolean $sameca = true,
Puppet::Platform $platform_name = 'puppet7',
String $server = 'puppet',
String $server_ipaddress = '127.0.0.1',
Boolean $use_puppetdb = true,
Boolean $puppetdb_local = true,
String $puppetdb_server = 'puppet',
Array[String] $puppetdb_ssl_protocols = ['TLSv1.2', 'TLSv1.3'],
Array[String] $puppetdb_cipher_suites = [
'TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256',
'TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256',
'TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384',
'TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384',
'TLS_DHE_RSA_WITH_AES_256_GCM_SHA384',
'TLS_DHE_RSA_WITH_AES_128_GCM_SHA256',
],
Boolean $manage_puppet_config = false,
Boolean $postgres_local = true,
Boolean $manage_database = $postgres_local,
Stdlib::Host $postgres_database_host = 'localhost',
String $postgres_database_name = 'puppetdb',
String $postgres_database_username = 'puppetdb',
String $postgres_database_password = 'puppetdb',
Boolean $manage_puppetdb_firewall = false,
Stdlib::Unixpath $r10k_cachedir = $puppet::params::r10k_cachedir,
Boolean $hosts_update = true,
Stdlib::Unixpath $import_path = '/root/ca',
Boolean $use_common_env = false,
Optional[String] $common_envname = undef,
Optional[Stdlib::Host] $ca_server = undef,
Optional[String] $enc_envname = undef,
Boolean $r10k_crontab_setup = false,
Boolean $manage_webserver_conf = false,
Boolean $manage_fileserver_config = true,
Hash[String, Stdlib::Absolutepath] $mount_points = {},
) inherits puppet::params {
# https://tickets.puppetlabs.com/browse/SERVER-346
class { 'puppet':
master => true,
server => $server,
server_ipaddress => $server_ipaddress,
use_puppetdb => $use_puppetdb,
sameca => $sameca,
use_common_env => $use_common_env,
common_envname => $common_envname,
enc_envname => $enc_envname,
}
class { 'puppet::globals':
platform_name => $platform_name,
}
class { 'puppet::agent::install': }
class { 'puppet::server::install': }
class { 'puppet::config':
puppet_server => true,
ca_server => $ca_server,
manage_webserver_conf => $manage_webserver_conf,
manage_fileserver_config => $manage_fileserver_config,
mount_points => $mount_points,
}
# r10k is not optional in our workflow, it should replace initial setup with
# real infrastructure setup.
class { 'puppet::r10k::gem_install':
manage_puppet_config => $manage_puppet_config,
r10k_cachedir => $r10k_cachedir,
}
class { 'puppet::r10k::config':
r10k_config_setup => false,
cachedir => $r10k_cachedir,
}
class { 'puppet::server::setup':
r10k_config_manage => true,
r10k_crontab_setup => $r10k_crontab_setup,
}
Class['puppet::r10k::gem_install'] -> Class['puppet::server::setup']
# https://puppet.com/docs/puppetdb/latest/install_via_module.html#step-2-assign-classes-to-nodes
# 1) If you are installing PuppetDB on the same server as your Puppet Server, assign
# the `puppetdb` and `puppetdb::master::config` classes to it.
# 2) If you want to run PuppetDB on its own server with a local PostgreSQL
# instance, assign the puppetdb class to it, and assign the puppetdb::master::config
# class to your Puppet Server. Make sure to set the class parameters as necessary.
if $use_puppetdb {
if $puppetdb_local {
class { 'puppet::puppetdb':
manage_database => $manage_database,
postgres_database_host => $postgres_database_host,
postgres_database_name => $postgres_database_name,
postgres_database_username => $postgres_database_username,
postgres_database_password => $postgres_database_password,
ssl_protocols => $puppetdb_ssl_protocols,
cipher_suites => $puppetdb_cipher_suites,
manage_firewall => $manage_puppetdb_firewall,
}
Class['puppet::puppetdb'] -> Class['puppet::service']
}
# Notes:
# 1) as hostname by default is set by class Puppet to `puppet` - use it as
# PuppetDB server name as well (predefined with profile parameter `puppetdb_server`)
# 2) By default class Puppet generates Puppet config (puppet.conf) from
# template therefore we do not want to manage it inside class
# Puppetdb::Master::Config (see `manage_puppet_config` parameter
# description)
# 3) Puppet service resource name provided by Puppet::Service class has
# name 'puppet-server'
#
class { 'puppetdb::master::config':
puppetdb_server => $puppetdb_server,
manage_storeconfigs => $manage_puppet_config,
manage_report_processor => $manage_puppet_config,
create_puppet_service_resource => false,
puppet_service_name => 'puppet-server',
}
Class['puppetdb::master::config'] -> Class['puppet::service']
}
class { 'puppet::service': }
class { 'puppet::setup':
hosts_update => $hosts_update,
}
include puppet::agent::schedule
Class['puppet::agent::install']
-> Class['puppet::config']
-> Class['puppet::agent::schedule']
}
|