collect staticsync ssh authkeys
authorPeter Palfrader <peter@palfrader.org>
Sat, 7 Sep 2019 23:14:37 +0000 (01:14 +0200)
committerPeter Palfrader <peter@palfrader.org>
Sat, 7 Sep 2019 23:14:37 +0000 (01:14 +0200)
modules/roles/manifests/static_base.pp
modules/roles/templates/static-mirroring/staticsync-authorized_keys.erb [deleted file]

index 1c8e74d..7527387 100644 (file)
@@ -7,19 +7,15 @@ class roles::static_base {
     key         => $facts['staticsync_key'],
     collect_tag => 'staticsync',
   }
-#  ssh::authorized_key_collect { 'staticsync':
-#    target_user => 'staticsync',
-#    collect_tag => 'staticsync',
-#  }
+  ssh::authorized_key_collect { 'staticsync':
+    target_user => 'staticsync',
+    collect_tag => 'staticsync',
+  }
 
   file { '/etc/static-components.conf':
     content => template('roles/static-mirroring/static-components.conf.erb'),
   }
 
-  file { '/etc/ssh/userkeys/staticsync':
-    content => template('roles/static-mirroring/staticsync-authorized_keys.erb'),
-  }
-
   file { '/usr/local/bin/staticsync-ssh-wrap':
     source => 'puppet:///modules/roles/static-mirroring/staticsync-ssh-wrap',
     mode   => '0555',
diff --git a/modules/roles/templates/static-mirroring/staticsync-authorized_keys.erb b/modules/roles/templates/static-mirroring/staticsync-authorized_keys.erb
deleted file mode 100644 (file)
index 12492f3..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-##
-## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
-##
-
-<%=
-def getstaticsynckey(host)
-    key = nil
-    begin
-        facts = YAML.load(File.open("/var/lib/puppet/yaml/facts/#{host}.yaml").read)
-        return facts.values['staticsync_key']
-    rescue Exception => e
-    end
-    return key
-end
-
-allnodeinfo = scope.lookupvar('site::allnodeinfo')
-roles = scope.lookupvar('site::roles')
-
-callers = []
-
-%w{static_mirror static_source static_master}.each do |role|
-    roles[role].each do |node|
-        key = getstaticsynckey(node)
-        callers << { 'node' => node, 'addr' => allnodeinfo[node]['ipHostNumber'], 'key' => key}
-    end
-end
-
-lines = []
-for m in callers do
-    lines << '# ' + m['node']
-    if m['key'].nil?
-        lines << "# no key for node"
-    else
-        lines << "command=\"/usr/local/bin/staticsync-ssh-wrap #{m['node']}\"," +
-                 'no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-user-rc,' +
-                 'from="' + m['addr'].join(',') + '" ' +
-                 m['key']
-    end
-end
-
-lines.join("\n")
-# vim:set et:
-# vim:set sts=4 ts=4:
-# vim:set shiftwidth=4:
-%>