Add any groups that are passed in as options

This commit is contained in:
David Boucha 2013-08-21 15:09:57 -06:00
parent 7647993c9e
commit 3c6cec6dfd

View File

@ -51,6 +51,9 @@ def add(name,
salt '*' user.add name password salt '*' user.add name password
''' '''
ret = __salt__['cmd.run_all']('net user {0} /add'.format(name)) ret = __salt__['cmd.run_all']('net user {0} /add'.format(name))
if groups:
for group in groups:
__salt__['user.addgroup'](name, group)
return ret['retcode'] == 0 return ret['retcode'] == 0