Skip to content

Commit

Permalink
Notes on adding smbhash.
Browse files Browse the repository at this point in the history
  • Loading branch information
arensb committed Mar 11, 2024
1 parent 71854c0 commit 75d6fa0
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion plugins/modules/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -327,6 +340,7 @@ def main():
# doing this.

smb=dict(type='bool', default=True),
# XXX - Add smbhash

sudo_commands=dict(type='list',
elements='str'),
Expand Down Expand Up @@ -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'] \
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 75d6fa0

Please sign in to comment.