X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fstaticsync%2Fmanifests%2Fssh.pp;h=d3373f03fc5b86c5ae9acf011c0264ad83a0cbc8;hb=9a69220cc9cf9388a8336e0c4fd65489e8933367;hp=22078cb602625ec6f3e3223e861bbbabc39030b4;hpb=0c067639ec7d7050b69249b85e6aa83ab91820b5;p=mirror%2Fdsa-puppet.git diff --git a/modules/staticsync/manifests/ssh.pp b/modules/staticsync/manifests/ssh.pp index 22078cb60..d3373f03f 100644 --- a/modules/staticsync/manifests/ssh.pp +++ b/modules/staticsync/manifests/ssh.pp @@ -1,20 +1,20 @@ # wrapper for ssh setup for statichosts -class roles::static::ssh( +class staticsync::ssh ( Variant[Array[String], String] $add_tag, String $collect_tag, - ) -{ - ssh::keygen {'staticsync': } +) { + ssh::keygen { $staticsync::user : } - ssh::authorized_key_add { 'staticsync': - target_user => 'staticsync', + ssh::authorized_key_add { "staticsync-${staticsync::user}": + target_user => $staticsync::user, + key => dig($facts, 'ssh_keys_users', $staticsync::user, 'id_rsa.pub', 'line'), command => "/usr/local/bin/staticsync-ssh-wrap ${::fqdn}", - key => $facts['staticsync_key'], - options => ['restrict', 'pty'], + options => ['restrict','pty'], + from => $staticsync::public_addresses, collect_tag => $add_tag, } - ssh::authorized_key_collect { 'staticsync': - target_user => 'staticsync', + ssh::authorized_key_collect { "staticsync-${staticsync::user}": + target_user => $staticsync::user, collect_tag => $collect_tag, } }