OLD | NEW |
(Empty) | |
| 1 # == Class: adblockplus::puppet::agent |
| 2 # |
| 3 # Manage Puppet (https://github.com/puppetlabs/puppet) agent configuration. |
| 4 # |
| 5 # === Parameters: |
| 6 # |
| 7 # [*package*] |
| 8 # Custom parameters for the implicit Package['puppet'] resource. |
| 9 # |
| 10 # [*service*] |
| 11 # Custom parameters for the Service['puppet'] resource implicitly defined |
| 12 # if Package['puppet'] is ensured to be neither "absent" nor "purged". |
| 13 # |
| 14 # === Examples: |
| 15 # |
| 16 # class {'adblockplus::puppet::agent': |
| 17 # package => { |
| 18 # 'ensure' => 'present', |
| 19 # 'name' => 'puppet', |
| 20 # }, |
| 21 # service => { |
| 22 # 'ensure' => 'stopped', |
| 23 # 'name' => 'puppet', |
| 24 # }, |
| 25 # } |
| 26 # |
| 27 class adblockplus::puppet::agent ( |
| 28 $package = hiera('adblockplus::puppet::agent::package', {}), |
| 29 $service = hiera('adblockplus::puppet::agent::service', {}), |
| 30 ) { |
| 31 |
| 32 include adblockplus::puppet |
| 33 include stdlib |
| 34 |
| 35 # https://forge.puppet.com/puppetlabs/stdlib#ensure_resource |
| 36 ensure_resource('package', 'puppet', merge({ |
| 37 'ensure' => $adblockplus::puppet::ensure, |
| 38 }, $package)) |
| 39 |
| 40 # https://forge.puppet.com/puppetlabs/stdlib#getparam |
| 41 if getparam(Package['puppet'], 'ensure') !~ /^(absent|purged)$/ { |
| 42 |
| 43 ensure_resource('service', 'puppet', merge({ |
| 44 'ensure' => 'stopped', |
| 45 'hasrestart' => true, |
| 46 'hasstatus' => true, |
| 47 }, $service)) |
| 48 |
| 49 Service['puppet'] <- Package['puppet'] |
| 50 } |
| 51 } |
OLD | NEW |