From 75d6fa0bd8106beb8996ba0d4eeedca128b17b8a Mon Sep 17 00:00:00 2001 From: Andrew Arensburger Date: Mon, 11 Mar 2024 15:46:17 -0400 Subject: [PATCH] Notes on adding smbhash. --- plugins/modules/user.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/plugins/modules/user.py b/plugins/modules/user.py index df41765..f7d234e 100644 --- a/plugins/modules/user.py +++ b/plugins/modules/user.py @@ -3,6 +3,16 @@ # Create and manage users. +# XXX - Bug with passwordless users and SMB under TrueNAS SCALE: +# https://github.com/arensb/ansible-truenas/issues/12 +# +# Still not sure of the contours of this one. Under TrueNAS CORE, it +# looks as though a user's Unix and SMB passwords are more or less +# independent (XXX this needs to be checked). +# +# Under SCALE, however, it sounds as though a user must have a +# password in order to have access to SMB. + DOCUMENTATION = ''' --- module: user @@ -115,6 +125,10 @@ - Specifies whether user should have access to SMB shares. type: bool default: true + smbhash: + description: + - SMB authorization string, crypted. + type: str ssh_authorized_keys: description: - List of ssh public keys to put in the user's C(.ssh/authorized_keys) @@ -227,7 +241,6 @@ # For parsing version numbers from packaging import version - def main(): # Figure out which version of TrueNAS we're running, and thus how # to call middlewared. @@ -327,6 +340,7 @@ def main(): # doing this. smb=dict(type='bool', default=True), + # XXX - Add smbhash sudo_commands=dict(type='list', elements='str'), @@ -435,6 +449,7 @@ def main(): state = module.params['state'] delete_group = module.params['delete_group'] smb = module.params['smb'] + # XXX - Add smbhash sudo = module.params['sudo'] \ if 'sudo' in module.params else None sudo_nopasswd = module.params['sudo_nopasswd'] \ @@ -521,6 +536,8 @@ def main(): if smb is not None: arg['smb'] = smb + # XXX - Add smbhash + if old_sudo_call: # 'old_sudo_call' isn't set to True until we know that # middleware uses the old sudo API. So by the time we @@ -742,6 +759,8 @@ def main(): if smb is not None and user_info['smb'] != smb: arg['smb'] = smb + # XXX - Add smbhash + if home is not None: # If the username has also changed, need to update the # home directory as well.