mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
fix issue #26207
This commit is contained in:
parent
d14d7b2c0e
commit
dad1920626
1 changed files with 18 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue