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

Side by Side Diff: modules/base/manifests/init.pp

Issue 29366882: Issue 3574 - Refactor Puppet class base into class adblockplus (Closed)
Patch Set: For comment 6 Created Dec. 6, 2016, 11:42 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/init.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 base ($zone='adblockplus.org') {
2
3 $servers = hiera('servers')
4 create_resources(base::explicit_host_record, $servers)
5
6 define explicit_host_record(
7 $ip,
8 $ssh_public_key = undef,
9 $role = undef,
10 $dns = undef,
11 $groups = undef,
12 ) {
13
14 $fqdn = $dns ? {
15 undef => "$name.${base::zone}",
16 default => $dns,
17 }
18
19 $ips = is_array($ip) ? {
20 true => $ip,
21 default => [$ip],
22 }
23
24 $public_key = $ssh_public_key ? {
25 undef => undef,
26 default => "ssh-rsa $ssh_public_key $fqdn",
27 }
28
29 adblockplus::host {$title:
30 fqdn => $fqdn,
31 groups => $groups,
32 ips => $ips,
33 name => $name,
34 role => $role,
35 public_key => $public_key,
36 }
37 }
38 }
OLDNEW
« no previous file with comments | « modules/adblockplus/manifests/init.pp ('k') | modules/private-stub/hiera/hosts.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld