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

reviewable/pr18780/r1
James Tanner 11 years ago
parent 2b20be94e0
commit 54781bdfe1

@ -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