Puppet Class: puppet::setup
- Inherits:
- puppet::params
- Defined in:
- manifests/setup.pp
Summary
Puppet node environment setup (either agent or server host)Overview
puppet::setup
Puppet node environment setup
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 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 |
# File 'manifests/setup.pp', line 18
class puppet::setup (
String $server_name = $puppet::server,
Boolean $hosts_update = $puppet::hosts_update,
Optional[String] $server_ipaddress = $puppet::server_ipaddress,
Optional[Array[String]] $dns_alt_names = $puppet::dns_alt_names,
Boolean $external_facts_setup = $puppet::external_facts_setup,
Boolean $wrapper_setup = true,
) inherits puppet::params {
if $hosts_update and $server_ipaddress {
host { $server_name:
ensure => 'present',
ip => $server_ipaddress,
host_aliases => $dns_alt_names,
}
}
if $external_facts_setup {
# https://puppet.com/docs/puppet/7.5/external_facts.html#executable-fact-locations
file {
['/etc/facter',
'/etc/facter/facts.d',
'/opt/puppetlabs/facter',
'/opt/puppetlabs/facter/facts.d',
'/etc/puppetlabs/facter',
'/etc/puppetlabs/facter/facts.d']:
ensure => directory,
}
}
if $wrapper_setup {
file { '/usr/local/sbin/agentrun':
ensure => file,
group => 'root',
owner => 'root',
mode => '0744',
content => file('puppet/agentrun'),
}
file { '/usr/local/sbin/agentrun.now':
ensure => link,
target => '/usr/local/sbin/agentrun',
}
}
}
|