mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Added logic for os x in the user state
This commit is contained in:
parent
ac008bf22d
commit
d7d6f45558
@ -615,7 +615,9 @@ def present(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 'shadow.info' in __salt__ \
|
||||
and not salt.utils.is_windows()\
|
||||
and not salt.utils.is_darwin():
|
||||
if password and not empty_password:
|
||||
__salt__['shadow.set_password'](name, password)
|
||||
spost = __salt__['shadow.info'](name)
|
||||
@ -686,6 +688,13 @@ def present(name,
|
||||
' {1}'.format(name, 'XXX-REDACTED-XXX')
|
||||
ret['result'] = False
|
||||
ret['changes']['passwd'] = 'XXX-REDACTED-XXX'
|
||||
elif salt.utils.is_darwin() and password and not empty_password:
|
||||
if not __salt__['shadow.set_password'](name, password):
|
||||
ret['comment'] = 'User {0} created but failed to set' \
|
||||
' password to' \
|
||||
' {1}'.format(name, 'XXX-REDACTED-XXX')
|
||||
ret['result'] = False
|
||||
ret['changes']['passwd'] = 'XXX-REDACTED-XXX'
|
||||
else:
|
||||
ret['comment'] = 'Failed to create new user {0}'.format(name)
|
||||
ret['result'] = False
|
||||
|
Loading…
Reference in New Issue
Block a user