Skip to content

Commit

Permalink
user: Add 'smb' parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
arensb committed Mar 3, 2024
1 parent 5b086b4 commit 71854c0
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion plugins/modules/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@
- User's shell.
- Must be one of the allowed shells from C(/etc/shells).
type: str
smb:
description:
- Specifies whether user should have access to SMB shares.
type: bool
default: true
ssh_authorized_keys:
description:
- List of ssh public keys to put in the user's C(.ssh/authorized_keys)
Expand Down Expand Up @@ -278,7 +283,7 @@ def main():
# x password_disabled(bool)
# - locked(bool)
# - microsoft_account(bool)
# - smb(bool) - Does user have access to SMB shares?
# x smb(bool) - Does user have access to SMB shares?
# x sudo(bool)
# x sudo_nopasswd(bool)
# x sudo_commands(bool)
Expand Down Expand Up @@ -321,6 +326,8 @@ def main():
# XXX - remove: delete home directory. builtin.user allows
# doing this.

smb=dict(type='bool', default=True),

sudo_commands=dict(type='list',
elements='str'),
sudo_commands_nopasswd=dict(type='list',
Expand Down Expand Up @@ -427,6 +434,7 @@ def main():
email = module.params['email']
state = module.params['state']
delete_group = module.params['delete_group']
smb = module.params['smb']
sudo = module.params['sudo'] \
if 'sudo' in module.params else None
sudo_nopasswd = module.params['sudo_nopasswd'] \
Expand Down Expand Up @@ -510,6 +518,9 @@ def main():
if uid is not None:
arg['uid'] = uid

if smb is not None:
arg['smb'] = smb

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 @@ -728,6 +739,9 @@ def main():
if shell is not None and user_info['shell'] != shell:
arg['shell'] = shell

if smb is not None and user_info['smb'] != smb:
arg['smb'] = smb

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 71854c0

Please sign in to comment.