This puppet module allows to easily manage your SSH pubic keys distribution across your Infrastructure.
It has several advantages compared to the original ssh_authorized_key which comes with Puppet.
- allows to distribute the same key to multiple users on the same node. The original ssh_authorized_key treats the comment as the resource namevar, hence if you need to distribute the same key to two different users on the same machine, it will error out saying that the resource already exists
- ssh public keys are stored in hiera
- optionally look up ssh_public_keys node fact from PuppetDB
The module is quite simple per se. You would only need to use the defined type ssh::authorized_key to roll out your keys.
ssh::authorized_key {"user1:[email protected]": }
ssh::authorized_key {"user2:[email protected]": }
The title is a composite namevar made of:
<target_user>:<ssh_key_comment>
Should you want to use ext_ssh_authorized_key directly, you would write it like this:
ext_ssh_authorized_key {"user1:ssh-dss:[email protected]":
key => "<user_key>",
ensure => "present" # default in any case
}
Matteo Cerutti - [email protected]