Index: modules/base/manifests/init.pp |
diff --git a/modules/base/manifests/init.pp b/modules/base/manifests/init.pp |
index 4f50711a0c470eb26d81264c62e6465ea0d6f1dc..f2461f0fa0d67a61215a63830f74e6046bc21aed 100644 |
--- a/modules/base/manifests/init.pp |
+++ b/modules/base/manifests/init.pp |
@@ -39,4 +39,23 @@ class base { |
class {'logrotate': |
stage => 'post' |
} |
+ |
+ $servers = hiera("servers") |
+ create_resources(base::explicit_host_record, $servers) |
+ |
+ define explicit_host_record($ip, $ssh_public_key=undef){ |
+ host{"$name,$ip": |
Wladimir Palant
2014/09/09 18:15:06
Will this work correctly for hosts that have multi
mathias
2014/10/08 03:02:33
It will, although the host{$key:} looks awkward th
|
+ ensure => present, |
+ ip => $ip, |
+ name => "$name.adblockplus.org", |
Wladimir Palant
2014/09/09 18:15:06
Unfortunately, this isn't all that simple right no
mathias
2014/10/08 03:02:33
Done.
|
+ } |
+ |
+ if $ssh_public_key != undef { |
+ @sshkey{$name: |
+ key => $ssh_public_key, |
+ type => ssh-rsa, |
Wladimir Palant
2014/09/09 18:15:06
Not sure but I guess that the IP addresses of the
mathias
2014/10/08 03:02:33
Done.
|
+ } |
+ } |
+ } |
} |
+ |