Puppet Class: puppet::server::bootstrap
- Defined in:
- manifests/server/bootstrap.pp
Summary
Puppet server bootstrapOverview
Puppet server bootstrap This is intended to be run via ‘puppet apply` command
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 |
# File 'manifests/server/bootstrap.pp', line 39
class puppet::server::bootstrap (
Optional[Stdlib::Unixpath] $path = undef,
String $agent_version = 'installed',
Optional[String] $node_environment = undef,
Boolean $use_ssh = true,
Optional[String] $certname = undef,
Array[Stdlib::Host] $dns_alt_names = [],
) {
class { 'puppet::agent::install':
agent_version => $agent_version,
}
$static_certname = $certname ? {
String => true,
default => false,
}
$dns_alt_names_bootstrap = $dns_alt_names + ['puppet', $facts['networking']['fqdn']]
class { 'puppet::config':
node_environment => $node_environment,
# to avoid "Server Error: Could not find terminus puppetdb for indirection facts"
# as PuppetDB is not installed yet
use_puppetdb => false,
static_certname => $static_certname,
certname => $certname,
dns_alt_names => $dns_alt_names_bootstrap.unique,
}
class { 'puppet::setup':
server_name => 'puppet',
server_ipaddress => '127.0.0.1',
}
include puppet::r10k::install
include puppet::server::setup::filesystem
include puppet::server::bootstrap::globals
include puppet::server::bootstrap::setup
include puppet::server::bootstrap::keys
include puppet::server::bootstrap::hiera
include puppet::server::bootstrap::ssh
$access_data = $puppet::server::bootstrap::globals::access_data
$bootstrap_path = $puppet::server::bootstrap::globals::bootstrap_path
$cwd = $puppet::server::bootstrap::globals::cwd
if ($use_ssh and $access_data[0]) or ! $use_ssh {
class { 'puppet::r10k::run':
setup_on_each_run => true,
cwd => $cwd,
require => [
Class['puppet::server::bootstrap::ssh'],
Class['puppet::server::setup::filesystem'],
],
}
Class['puppet::r10k::run'] -> Class['puppet::server::bootstrap::hiera']
}
class { 'puppet::server::ca::import':
dns_alt_names => $dns_alt_names_bootstrap.unique,
import_path => "${bootstrap_path}/ca",
require => File["${bootstrap_path}/ca"],
}
class { 'puppet::service':
server_service_ensure => 'running',
server_service_enable => true,
}
Class['puppet::server::ca::import'] -> Class['puppet::service']
}
|