| OLD | NEW |
| (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 } | |
| OLD | NEW |