puppet-prod/site/profile/manifests/puppet/server.pp
Ben Vincent 9536be5864 Inital commit for profile::puppet::*
* profile::pupper::server
  * profile::puppet::puppetmaster
  * profile::puppet::g10k
  * profile::puppet::autosign
  * updated Puppetfile
  * updated role::puppet::puppetmaster
  * added profile::puppet::puppetmaster to puppetmaster role
  * added profile::puppet::server templates
2023-06-21 21:17:07 +10:00

58 lines
1.6 KiB
Puppet

# Class: profile::puppet::server
#
# This class manages Puppet server's configuration and service.
#
# Parameters:
# vardir - Directory path for variable data.
# logdir - Directory path for logs.
# rundir - Directory path for run-time data.
# pidfile - File path for the PID file.
# codedir - Directory path for code data.
# dns_alt_names - Array of alternate DNS names for the server.
# server - Server's name.
# node_terminus - Node terminus.
# external_nodes - Path to the external node classifier script.
# autosign - Path to the autosign script.
#
class profile::puppet::server (
String $vardir,
String $logdir,
String $rundir,
String $pidfile,
String $codedir,
Array[String[1]] $dns_alt_names,
String $server,
String $node_terminus,
String $external_nodes,
String $autosign,
) {
file { '/etc/puppetlabs/puppet/puppet.conf':
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
content => epp('profile/puppet/server/puppet.conf.epp', {
'vardir' => $vardir,
'logdir' => $logdir,
'rundir' => $rundir,
'pidfile' => $pidfile,
'codedir' => $codedir,
'dns_alt_names' => join($dns_alt_names, ','),
'server' => $server,
'node_terminus' => $node_terminus,
'external_nodes' => $external_nodes,
'autosign' => $autosign,
}),
notify => Service['puppetserver'],
}
service { 'puppetserver':
ensure => running,
enable => true,
hasstatus => true,
hasrestart => true,
}
}