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

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

Issue 29370632: NoIssue - Refactor ensure_*state functions (Closed)
Patch Set: Created Jan. 3, 2017, 2:25 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
1 # == Class: adblockplus::puppet::agent 1 # == Class: adblockplus::puppet::agent
2 # 2 #
3 # Manage Puppet (https://github.com/puppetlabs/puppet) agent configuration. 3 # Manage Puppet (https://github.com/puppetlabs/puppet) agent configuration.
4 # 4 #
5 # === Parameters: 5 # === Parameters:
6 # 6 #
7 # [*package*] 7 # [*package*]
8 # Custom parameters for the implicit Package['puppet'] resource. 8 # Custom parameters for the implicit Package['puppet'] resource.
9 # 9 #
10 # [*service*] 10 # [*service*]
(...skipping 20 matching lines...) Expand all
31 31
32 include adblockplus::puppet 32 include adblockplus::puppet
33 include stdlib 33 include stdlib
34 34
35 # https://forge.puppet.com/puppetlabs/stdlib#ensure_resource 35 # https://forge.puppet.com/puppetlabs/stdlib#ensure_resource
36 ensure_resource('package', 'puppet', merge({ 36 ensure_resource('package', 'puppet', merge({
37 'ensure' => $adblockplus::puppet::ensure, 37 'ensure' => $adblockplus::puppet::ensure,
38 }, $package)) 38 }, $package))
39 39
40 # https://forge.puppet.com/puppetlabs/stdlib#getparam 40 # https://forge.puppet.com/puppetlabs/stdlib#getparam
41 if getparam(Package['puppet'], 'ensure') !~ /^(absent|purged)$/ { 41 if ensure_state(Package['puppet']) {
42 42
43 ensure_resource('service', 'puppet', merge({ 43 ensure_resource('service', 'puppet', merge({
44 'ensure' => 'stopped', 44 'ensure' => 'stopped',
45 'hasrestart' => true, 45 'hasrestart' => true,
46 'hasstatus' => true, 46 'hasstatus' => true,
47 }, $service)) 47 }, $service))
48 48
49 Service['puppet'] <- Package['puppet'] 49 Service['puppet'] <- Package['puppet']
50 } 50 }
51 } 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