Fixes #4554 Enumerate user homedir if not passed as an argument

pull/4568/merge
James Tanner 11 years ago
parent 8a516d1479
commit 4f674ec522

@ -1513,9 +1513,11 @@ def main():
result['ssh_public_key'] = user.get_ssh_public_key()
# handle missing homedirs
info = user.user_info()
if user.home is None:
user.home = info[5]
if not os.path.exists(user.home) and user.createhome:
if not module.check_mode:
info = user.user_info()
user.create_homedir(user.home)
user.chown_homedir(info[2], info[3], user.home)
result['changed'] = True

Loading…
Cancel
Save