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

Side by Side Diff: modules/adblockplus/manifests/puppet/master.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
« no previous file with comments | « modules/adblockplus/manifests/puppet.pp ('k') | modules/private-stub/hiera/hosts.yaml » ('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::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)
f.lopez 2016/12/14 16:12:37 +1 for using ensure_resources instead of ensure_pa
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 }
OLDNEW
« no previous file with comments | « modules/adblockplus/manifests/puppet.pp ('k') | modules/private-stub/hiera/hosts.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld