diff --git a/system/user b/system/user index 2e47055b7e9..0528bd5d115 100644 --- a/system/user +++ b/system/user @@ -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