This commit is contained in:
Julien Cigar 2015-08-12 13:13:59 +02:00 committed by rallytime
parent d14d7b2c0e
commit dad1920626

View File

@ -130,3 +130,21 @@ def chgid(name, gid):
if post_gid != pre_gid:
return post_gid == gid
return False
def members(name, members_list):
'''
Replaces members of the group with a provided list.
CLI Example:
salt '*' group.members foo 'user1,user2,user3,...'
Replaces a membership list for a local group 'foo'.
foo:x:1234:user1,user2,user3,...
'''
retcode = __salt__['cmd.retcode']('pw groupmod {0} -M {1}'.format(
name, members_list), python_shell=False)
return not retcode