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: Created Dec. 6, 2016, 10:40 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
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

Powered by Google App Engine
This is Rietveld