Add puppet classes to store and collect ssh authkeys information
[mirror/dsa-puppet.git] / modules / ssh / manifests / authorized_key_collect.pp
1 # collect authorized_keys stored using authorized_key_add
2
3 define ssh::authorized_key_collect(
4   String $target_user,
5   String $collect_tag,
6 ) {
7   concat { "/etc/ssh/userkeys/${target_user}": }
8   concat::fragment { "/etc/ssh/userkeys/${target_user}-header":
9     target  => "/etc/ssh/userkeys/${target_user}",
10     order   => '000',
11     content => "# This file is maintained with puppet\n",
12   }
13   Concat::Fragment <<| tag == "ssh::authorized_key::fragment::${collect_tag}::${target_user}" |>>
14
15   Ferm::Rule <<| tag == "ssh::authorized_key::ferm::${collect_tag}::${target_user}" |>>
16 }