The newest version of OpenSSH supports a new, wonderful key type. authorized_key incorrectly discards pubkeys of this type as busted because it doesn't recognize type signature.
it start to duplicate line, because this create
a empty option in the list, and so the module add a new line along the previous
one. See
>>> ' a,b, '.strip().split(',')
['a', 'b', '']
A small refactoring of the authorized_key module to accomodate these
changes, plus fixing some things like not rewriting the file on every
new key. These changes bring the original feature for ssh options in-
line with the comments in #3798Fixes#3785
Migrated all examples: in DOCUMENTATION=''' string to standalone EXAMPLES=''' string
Added deprecation warning to moduledev.rst and remove deprecated example from it
Fixed up a few typos and uppercased some acronyms.
add consistency to how EXAMPLES are formatted
* Clarified the meaning of 'user'
* Changed 'sshdir' to 'path' in the example
* 'sshdir' is used internally in the module, but the argument is 'path'
* Made the capitalization consistent in the descriptions
This commit fixes a bug where the authorized_key module causes
the ~user/.ssh directory to be owned by root instead of the user,
when the manage_dir argument is not specified.
If the manage_dir argument was not specified, the module behaved as if
manage_dir was set to false, even though it's supposed to default to
true.
This module assumed that an optional argument, with no default
specified, will not be present in the module.params dictionary.
What actually seems to happen is that the argument does appear in
the module.params dictionary with a value of None.
The upside is that this line was evaluating to None instead of
true:
manage_dir = params.get("manage_dir", True)
I fixed the problem in this particular module by explicitly specifying
the default value for the manage_dir arugment. But if this bug
occurred because of a change in behavior in AnsibleModule, then other
modules may be broken as well.