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

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

Issue 29367556: Issue 3065 - Refactor adblockplus::puppet module to include Puppet patches (Closed)
Patch Set: (remove accidental changes) Created Dec. 15, 2016, 10 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « modules/adblockplus/manifests/puppet.pp ('k') | modules/adblockplus/manifests/puppet/master.pp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 }
OLDNEW
« no previous file with comments | « modules/adblockplus/manifests/puppet.pp ('k') | modules/adblockplus/manifests/puppet/master.pp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld