mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fixes #4554 Enumerate user homedir if not passed as an argument
This commit is contained in:
parent
8a516d1479
commit
4f674ec522
1 changed files with 3 additions and 1 deletions
|
@ -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…
Reference in a new issue