mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Merge pull request #40325 from cxmcc/user-nologinit-option
Add 'nologinit' option for useradd module and user.present state.
This commit is contained in:
commit
d30ccede14
@ -116,7 +116,8 @@ def add(name,
|
||||
homephone='',
|
||||
createhome=True,
|
||||
loginclass=None,
|
||||
root=None):
|
||||
root=None,
|
||||
nologinit=False):
|
||||
'''
|
||||
Add a user to the minion
|
||||
|
||||
@ -178,6 +179,9 @@ def add(name,
|
||||
and __grains__['kernel'] != 'OpenBSD'):
|
||||
cmd.append('-M')
|
||||
|
||||
if nologinit:
|
||||
cmd.append('-l')
|
||||
|
||||
if home is not None:
|
||||
cmd.extend(['-d', home])
|
||||
|
||||
|
@ -221,7 +221,8 @@ def present(name,
|
||||
win_homedrive=None,
|
||||
win_profile=None,
|
||||
win_logonscript=None,
|
||||
win_description=None):
|
||||
win_description=None,
|
||||
nologinit=False):
|
||||
'''
|
||||
Ensure that the named user is present with the specified properties
|
||||
|
||||
@ -274,6 +275,13 @@ def present(name,
|
||||
Additionally, parent directories will *not* be created. The parent
|
||||
directory for ``home`` must already exist.
|
||||
|
||||
nologinit : False
|
||||
If set to ``True``, it will not add the user to lastlog and faillog
|
||||
databases.
|
||||
|
||||
.. note::
|
||||
Not supported on Windows or Mac OS.
|
||||
|
||||
password
|
||||
A password hash to set for the user. This field is only supported on
|
||||
Linux, FreeBSD, NetBSD, OpenBSD, and Solaris. If the ``empty_password``
|
||||
@ -635,6 +643,7 @@ def present(name,
|
||||
'workphone': workphone,
|
||||
'homephone': homephone,
|
||||
'createhome': createhome,
|
||||
'nologinit': nologinit,
|
||||
'loginclass': loginclass}
|
||||
else:
|
||||
params = ({'name': name,
|
||||
|
Loading…
Reference in New Issue
Block a user