Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: modules/adblockplus/manifests/puppet.pp

Issue 29367500: Issue 3065 - Introduce adblockplus::puppet::master module (Closed)
Patch Set: Created Dec. 14, 2016, 4:02 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # == Class: adblockplus::puppet
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':
17 # package => {
18 # 'ensure' => 'present',
19 # 'name' => 'puppet',
20 # },
21 # service => {
22 # 'ensure' => 'stopped',
23 # 'name' => 'puppet',
24 # },
25 # }
26 #
27 class adblockplus::puppet (
28 $package = hiera('adblockplus::puppet::package', {}),
29 $service = hiera('adblockplus::puppet::service', {}),
30 ) {
31
32 # https://forge.puppet.com/puppetlabs/stdlib
33 include stdlib
34
35 # https://forge.puppet.com/puppetlabs/stdlib#ensure_resource
36 ensure_resource('package', 'puppet', $package)
37
38 # https://forge.puppet.com/puppetlabs/stdlib#getparam
39 if getparam(Package['puppet'], 'ensure') !~ /^(absent|purged)$/ {
40
41 ensure_resource('service', 'puppet', merge({
42 'ensure' => 'stopped',
43 'hasrestart' => true,
44 'hasstatus' => true,
45 }, $service))
46
47 Service['puppet'] <- Package['puppet']
48 }
49 }
OLDNEW

Powered by Google App Engine
This is Rietveld