OLD | NEW |
1 # == Class: adblockplus::puppet::master | 1 # == Class: adblockplus::puppet::master |
2 # | 2 # |
3 # Manage Puppet (https://github.com/puppetlabs/puppet) master configuration. | 3 # Manage Puppet (https://github.com/puppetlabs/puppet) master configuration. |
4 # | 4 # |
5 # === Parameters: | 5 # === Parameters: |
6 # | 6 # |
7 # [*package*] | 7 # [*package*] |
8 # Custom parameters for the implicit Package['puppetmaster'] resource. | 8 # Custom parameters for the implicit Package['puppetmaster'] resource. |
9 # | 9 # |
10 # [*service*] | 10 # [*service*] |
(...skipping 11 matching lines...) Expand all Loading... |
22 # 'ensure' => 'running', | 22 # 'ensure' => 'running', |
23 # 'name' => 'puppetmaster', | 23 # 'name' => 'puppetmaster', |
24 # }, | 24 # }, |
25 # } | 25 # } |
26 # | 26 # |
27 class adblockplus::puppet::master ( | 27 class adblockplus::puppet::master ( |
28 $package = hiera('adblockplus::puppet::master::package', {}), | 28 $package = hiera('adblockplus::puppet::master::package', {}), |
29 $service = hiera('adblockplus::puppet::master::service', {}), | 29 $service = hiera('adblockplus::puppet::master::service', {}), |
30 ) { | 30 ) { |
31 | 31 |
32 include adblockplus | 32 include adblockplus::puppet |
33 include puppetmaster | 33 include puppetmaster |
34 include stdlib | 34 include stdlib |
35 | 35 |
36 # https://forge.puppet.com/puppetlabs/stdlib#ensure_resource | 36 # https://forge.puppet.com/puppetlabs/stdlib#ensure_resource |
37 ensure_resource('package', 'puppetmaster', $package) | 37 ensure_resource('package', 'puppetmaster', merge({ |
| 38 'ensure' => $adblockplus::puppet::ensure, |
| 39 }, $package)) |
38 | 40 |
39 # https://forge.puppet.com/puppetlabs/stdlib#getparam | 41 # https://forge.puppet.com/puppetlabs/stdlib#getparam |
40 if getparam(Package['puppet'], 'ensure') !~ /^(absent|purged)$/ { | 42 if getparam(Package['puppet'], 'ensure') !~ /^(absent|purged)$/ { |
41 | 43 |
42 ensure_resource('service', 'puppetmaster', merge({ | 44 ensure_resource('service', 'puppetmaster', merge({ |
43 'ensure' => 'running', | 45 'ensure' => 'running', |
44 'hasrestart' => true, | 46 'hasrestart' => true, |
45 'hasstatus' => true, | 47 'hasstatus' => true, |
46 }, $service)) | 48 }, $service)) |
47 | 49 |
48 Service['puppetmaster'] <- Package['puppetmaster'] | 50 Service['puppetmaster'] <- Package['puppetmaster'] |
49 } | 51 } |
50 } | 52 } |
OLD | NEW |