mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
only change/report new home when createhome is True
This commit is contained in:
parent
3fbf81611f
commit
3824d2e9fc
1 changed files with 4 additions and 1 deletions
|
@ -118,7 +118,7 @@ def _changes(name,
|
|||
if _group_changes(lusr['groups'], wanted_groups, remove_groups):
|
||||
change['groups'] = wanted_groups
|
||||
if home:
|
||||
if lusr['home'] != home:
|
||||
if lusr['home'] != home and createhome:
|
||||
change['home'] = home
|
||||
if createhome:
|
||||
newhome = home if home else lusr['home']
|
||||
|
@ -596,6 +596,9 @@ def present(name,
|
|||
if __salt__['user.add'](**params):
|
||||
ret['comment'] = 'New user {0} created'.format(name)
|
||||
ret['changes'] = __salt__['user.info'](name)
|
||||
if not createhome:
|
||||
# pwd incorrectly reports presence of home
|
||||
ret['changes']['home'] = ''
|
||||
if 'shadow.info' in __salt__ and not salt.utils.is_windows():
|
||||
if password and not empty_password:
|
||||
__salt__['shadow.set_password'](name, password)
|
||||
|
|
Loading…
Add table
Reference in a new issue