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

Unified Diff: modules/base/manifests/init.pp

Issue 4810150141493248: Issue 122 - Puppet ENC via Hiera (Closed)
Patch Set: Created Sept. 8, 2014, 11:56 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.
+ }
+ }
+ }
}
+

Powered by Google App Engine
This is Rietveld