Make staticsync a module and update references
[mirror/dsa-puppet.git] / modules / staticsync / manifests / ssh.pp
1 # wrapper for ssh setup for statichosts
2 class staticsync::ssh  (
3   Variant[Array[String], String] $add_tag,
4   String                         $collect_tag,
5 ) {
6   ssh::keygen { $staticsync::user : }
7
8   ssh::authorized_key_add { "staticsync-${staticsync::user}":
9     target_user => $staticsync::user,
10     key         => dig($facts, 'ssh_keys_users', $staticsync::user, 'id_rsa.pub', 'line'),
11     command     => "/usr/local/bin/staticsync-ssh-wrap ${::fqdn}",
12     options     => ['restrict','pty'],
13     from        => $staticsync::public_addresses,
14     collect_tag => $add_tag,
15   }
16   ssh::authorized_key_collect { "staticsync-${staticsync::user}":
17     target_user => $staticsync::user,
18     collect_tag => $collect_tag,
19   }
20 }