Commit Graph

3 Commits (9122efb24a72b6d4fbfc30e9ee677e0178404734)

Author SHA1 Message Date
Lorin Hochstein 8c9cceacbf authorized_key: Set manage_dir default value
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.
11 years ago
Oleg 3531fbdb29 fix for authorized_key: skip chown and chmod if authorized_key_file is link 12 years ago
Michael DeHaan 391fb98ee2 Allow modules to be categorized, and also sort them when generating the documentation. 12 years ago