ansible/ansible — pull request #3286 by madduck (2013-06-20 19:23:35+00:00)
Title: Add remove_other parameter to authorized_key module

If 'remove_other' is set to 'yes' in the parameters of an
authorized_key action, then the effect will be that the specified keys
shall replace *all* existing keys in the file.

This is useful if you want to ensure that only the specified keys can
log in. It defaults to 'no'.

Notes:

1. the diff is larger than needed because I tried to keep the spacing
proper.

2. there was a bit of refactoring, namely writekeys was being called
once for each new key. Now the changes are assembled in a set() and
written out only once at the end. I could see no reason why
writekeys should be called in every iteration.

3. It would be better to introduce state=exclusive or somesuch, maybe?
The reason why I did not do this is because I did not know how to
tell the docstring that a new choice appeared in version 1.3. How?

Signed-off-by: martin f. krafft