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