Yuvipanda has submitted this change and it was merged.

Change subject: Revert "Revert "Allow addition of more root keys via hiera""
......................................................................


Revert "Revert "Allow addition of more root keys via hiera""

Let's see if we can get this to work!

This reverts commit 79890ba1a92e2185108fa0b590ba1c48b4f45947.

Change-Id: I138b3bde5e56775b045c170b0f4c649c54c37dac
---
M modules/passwords/manifests/init.pp
R modules/passwords/root-authorized-keys.erb
2 files changed, 11 insertions(+), 2 deletions(-)

Approvals:
  Yuvipanda: Verified; Looks good to me, approved



diff --git a/modules/passwords/manifests/init.pp 
b/modules/passwords/manifests/init.pp
index c4d54d5..fdc5faa 100644
--- a/modules/passwords/manifests/init.pp
+++ b/modules/passwords/manifests/init.pp
@@ -4,14 +4,22 @@
 ##################################################
 ##################################################
 
-class passwords::root {
+class passwords::root(
+    $extra_keys = undef,
+){
     user { 'root':
         password => '!',
     }
 
+    if $extra_keys {
+        $flat_extra_keys = join(values($extra_keys), "\n")
+    } else {
+        $flat_extra_keys = ''
+    }
+
     ssh::userkey { 'root':
         ensure => present,
-        source => 'puppet:///private/ssh/root-authorized-keys',
+        content => template('passwords/root-authorized-keys.erb'),
     }
 }
 
diff --git a/files/ssh/root-authorized-keys 
b/modules/passwords/root-authorized-keys.erb
similarity index 98%
rename from files/ssh/root-authorized-keys
rename to modules/passwords/root-authorized-keys.erb
index e30c7c8..55a0943 100644
--- a/files/ssh/root-authorized-keys
+++ b/modules/passwords/root-authorized-keys.erb
@@ -22,3 +22,4 @@
 ssh-rsa 
AAAAB3NzaC1yc2EAAAADAQABAAABAQDt7HkyaZeIe7L8CuWE1+N47+wDT/4cUmEcrPA1xgdA4By/jesf+1oOTvusbIyXFuCssvspgGmwwNMD+PzNF3xAEo+Yn2aqH4OBhRiF0U8jeaJL1EhzKnT8KKG4fOzzerbKFlE5K9LnYhMXp2i6MoAN9xB3Z350dBwqhspf0OKqZ8AGbsc9RdcEr2pBT7RPRlcKXRTrd47keV+PUazpDVSr2MCdmErknROpcBh5IS27DrKHpma3UcNUGIeMsvsV6nyt8Tz2+EMGkd+P+whij0YzlKDkqB2ppoD+gCPAki277wobiocea79fvPm1/Na+tpXJT7gU+YErld4VRvUclyR/
 [email protected]
 # Chase
 ssh-rsa 
AAAAB3NzaC1yc2EAAAADAQABAAABAQDhIGvqUbSg+juihH7U9KiAdiKQMXQsIpMxQas9U3RZl/q1daQX7pLBOxjwT6yuqeMBUWP+DkTkIT5+kiexyWQyleKB+Hd/da5m78nqNpzxUYAAGTkBg0m1iz5KEYNn6hKX3VjnEjks56WyVhlDNDNTV6kaXClyUUTLv78EQryA8h+dzln2blOtmvAUDIGrGmE95UXXJyDPsvg3xTXXDr4s1ViRIkvCYOIMr5VzdnauGhkgX8AgfvX7r6wqVRjeeYSSM4ktK/CFDd2akI1p+o7jfqaKZpq9oI9RyvZl4vALv65ES1IM7wIitqw5fErLWYGlniPh+62cqgSKPu8roVoJ
 cpettet@cair
+<%= @flat_extra_keys %>

-- 
To view, visit https://gerrit.wikimedia.org/r/257808
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I138b3bde5e56775b045c170b0f4c649c54c37dac
Gerrit-PatchSet: 3
Gerrit-Project: labs/private
Gerrit-Branch: master
Gerrit-Owner: Yuvipanda <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: Yuvipanda <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to