mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
fix issue #26207
This commit is contained in:
parent
d14d7b2c0e
commit
dad1920626
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user