News for hackers. Stuff that matters.
Re:Ask HN: How do you manage SSH keys and SSL certificates i... by drinchev on Friday May 12, 2017 @03:17AM (#14322026)
How do you manage to "remove" SSH keys. Since sensible is stateless, you probably run once for removing and once for adding a new key.
Re:Ask HN: How do you manage SSH keys and SSL certificates i... by Spivak on Friday May 12, 2017 @08:37AM (#14323423)
There are two states that we're talking about.

* Ensure that the following key is present.

* Ensure that only the following keys are present.

You can accomplish the second one with the 'exclusive' flag.

http://docs.ansible.com/ansible/authorized_key_module.html

Re:Ask HN: How do you manage SSH keys and SSL certificates i... by falcolas on Friday May 12, 2017 @09:08AM (#14323633)
There's a third state as well: absent. Move keys from one file to another, and they go from allowed to denyed.

That said, I do like the "exclusive" tag too, I just tend to have a few one-off keys laying around as technical debt.

Re:Ask HN: How do you manage SSH keys and SSL certificates i... by lamby on Friday May 12, 2017 @04:19AM (#14322249)
Not the OP, but say you were populating a directory of keys, you would simply remove it via file's state=absent and then repopulate.
Re:Ask HN: How do you manage SSH keys and SSL certificates i... by dkhenry on Friday May 12, 2017 @09:39AM (#14323848)
You can have Ansible generate the authorized_keys file from a list of public key files, then when that list changes ansible will detect that the file has changed and will copy over the new file.
Re:Ask HN: How do you manage SSH keys and SSL certificates i... by ruffrey on Friday May 12, 2017 @11:30AM (#14324848)
For a file, specify state=absent

http://docs.ansible.com/ansible/file_module.html

Re:Ask HN: How do you manage SSH keys and SSL certificates i... by janvdberg on Friday May 12, 2017 @05:16AM (#14322468)
Yes, we run it once/only when things (people) change.