Merge pull request #1651 from verm666/issue-1515
fix authorized_keys in check_mode
This commit is contained in:
commit
1dc5074602
1 changed files with 13 additions and 6 deletions
|
@ -169,6 +169,13 @@ def keyfile(module, user, write=False, path=None, manage_dir=True):
|
|||
:return: full path string to authorized_keys for user
|
||||
"""
|
||||
|
||||
if module.check_mode:
|
||||
if path is None:
|
||||
module.fail_json(msg="You must provide full path to key file in check mode")
|
||||
else:
|
||||
keysfile = path
|
||||
return keysfile
|
||||
|
||||
try:
|
||||
user_entry = pwd.getpwnam(user)
|
||||
except KeyError, e:
|
||||
|
|
Loading…
Reference in a new issue