|
6 | 6 | # ['puppet_server'] - The dns name of the puppet master
|
7 | 7 | # ['puppet_server_port'] - The Port the puppet master is running on
|
8 | 8 | # ['puppet_agent_service'] - The service the puppet agent runs under
|
9 |
| -# ['puppet_agent_package'] - The name of the package providing the puppet agent |
10 |
| -# ['version'] - The version of the puppet agent to install |
11 | 9 | # ['mac_version'] - The package version for Mac OS X
|
12 | 10 | # ['mac_facter_version'] - The Factor Version for Mac OS X
|
| 11 | +# ['puppet_agent_package'] - The name of the package providing the puppet agent |
| 12 | +# ['version'] - The version of the puppet agent to install |
13 | 13 | # ['puppet_run_style'] - The run style of the agent either 'service', 'cron', 'external' or 'manual'
|
14 | 14 | # ['puppet_run_interval'] - The run interval of the puppet agent in minutes, default is 30 minutes
|
15 | 15 | # ['puppet_run_command'] - The command that will be executed for puppet agent run
|
|
39 | 39 | # ['serialization_package'] - defaults to undef, if provided, we install this package, otherwise we fall back to the gem from 'serialization_format'
|
40 | 40 | # ['http_proxy_host'] - The hostname of an HTTP proxy to use for agent -> master connections
|
41 | 41 | # ['http_proxy_port'] - The port to use when puppet uses an HTTP proxy
|
| 42 | +# ['localconfig'] - Where puppet agent caches the local configuration. An extension indicating the cache format is added automatically. |
| 43 | +# ['rundir'] - Where Puppet PID files are kept. |
| 44 | +# ['puppet_ssldir'] - Puppet sll directory |
42 | 45 | #
|
43 | 46 | # Actions:
|
44 | 47 | # - Install and configures the puppet agent
|
|
57 | 60 | $puppet_agent_service = $::puppet::params::puppet_agent_service,
|
58 | 61 | $puppet_agent_package = $::puppet::params::puppet_agent_package,
|
59 | 62 | $version = 'present',
|
60 |
| - $mac_version = '3.8.6', |
61 |
| - $mac_facter_version = '2.4.6', |
| 63 | + $puppet_facter_package = $::puppet::params::puppet_facter_package, |
62 | 64 | $puppet_run_style = 'service',
|
63 | 65 | $puppet_run_command = '/usr/bin/puppet agent --no-daemonize --onetime --logdest syslog > /dev/null 2>&1',
|
64 | 66 | $user_id = undef,
|
|
70 | 72 | $syslogfacility = undef,
|
71 | 73 | $priority = undef,
|
72 | 74 | $logdir = undef,
|
| 75 | + $rundir = $::puppet::params::rundir, |
73 | 76 |
|
74 | 77 | #[agent]
|
75 | 78 | $srv_domain = undef,
|
|
103 | 106 | $cron_minute = undef,
|
104 | 107 | $serialization_format = undef,
|
105 | 108 | $serialization_package = undef,
|
| 109 | + $localconfig = undef, |
| 110 | + $puppet_ssldir = $::puppet::params::puppet_ssldir, |
106 | 111 | ) inherits puppet::params {
|
107 | 112 |
|
108 | 113 | if ! defined(User[$::puppet::params::puppet_user]) {
|
|
121 | 126 | }
|
122 | 127 | case $::osfamily {
|
123 | 128 | 'Darwin': {
|
124 |
| - package {"facter-${mac_facter_version}.dmg": |
| 129 | + package {$puppet_facter_package: |
125 | 130 | ensure => present,
|
126 | 131 | provider => $package_provider,
|
127 |
| - source => "https://downloads.puppetlabs.com/mac/facter-${mac_facter_version}.dmg", |
| 132 | + source => "https://downloads.puppetlabs.com/mac/${puppet_facter_package}", |
128 | 133 | }
|
129 |
| - package { "puppet-${mac_version}.dmg": |
| 134 | + package { $puppet_agent_package: |
130 | 135 | ensure => present,
|
131 | 136 | provider => $package_provider,
|
132 |
| - source => "https://downloads.puppetlabs.com/mac/puppet-${mac_version}.dmg" |
| 137 | + source => "https://downloads.puppetlabs.com/mac/${puppet_agent_package}" |
133 | 138 | }
|
134 | 139 | }
|
135 | 140 | default: {
|
|
139 | 144 | }
|
140 | 145 | }
|
141 | 146 | }
|
| 147 | + |
142 | 148 | if $puppet_run_style == 'service' {
|
143 | 149 | $startonboot = 'yes'
|
144 | 150 | }
|
|
271 | 277 | }else {
|
272 | 278 | $orderign_ensure = 'absent'
|
273 | 279 | }
|
| 280 | + if $localconfig != undef { |
| 281 | + ini_setting {'puppetagentlocalconfig': |
| 282 | + ensure => present, |
| 283 | + setting => 'localconfig', |
| 284 | + value => $localconfig, |
| 285 | + } |
| 286 | + } |
| 287 | + if $puppet_ssldir != undef { |
| 288 | + ini_setting {'puppetagentsldir': |
| 289 | + ensure => present, |
| 290 | + section => 'main', |
| 291 | + setting => 'ssldir', |
| 292 | + value => $puppet_ssldir, |
| 293 | + } |
| 294 | + } |
| 295 | + |
| 296 | + # rundir has no default and must be provided. |
| 297 | + ini_setting {'puppetagentrundir': |
| 298 | + ensure => present, |
| 299 | + section => 'main', |
| 300 | + setting => 'rundir', |
| 301 | + value => $rundir, |
| 302 | + } |
| 303 | + |
274 | 304 | ini_setting {'puppetagentordering':
|
275 | 305 | ensure => $orderign_ensure,
|
276 | 306 | setting => 'ordering',
|
|
460 | 490 | }
|
461 | 491 | unless defined(Package['msgpack']) {
|
462 | 492 | package {'msgpack':
|
463 |
| - ensure => 'latest', |
464 |
| - provider => 'gem', |
465 |
| - require => Package[$::puppet::params::ruby_dev, 'gcc'], |
| 493 | + ensure => 'latest', |
| 494 | + provider => 'gem', |
| 495 | + require => Package[$::puppet::params::ruby_dev, 'gcc'], |
466 | 496 | }
|
467 | 497 | }
|
468 | 498 | }
|
|
0 commit comments