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