Manage groups on Linux, OpenBSD and NetBSD
salt.modules.groupadd.
add
(name, gid=None, system=False, root=None)¶Add the specified group
CLI 范例:
salt '*' group.add foo 3456
salt.modules.groupadd.
adduser
(name, username, root=None)¶Add a user in the group.
CLI 范例:
salt '*' group.adduser foo bar
Verifies if a valid username 'bar' as a member of an existing group 'foo', if not then adds it.
salt.modules.groupadd.
chgid
(name, gid, root=None)¶Change the gid for a named group
CLI 范例:
salt '*' group.chgid foo 4376
salt.modules.groupadd.
delete
(name, root=None)¶Remove the named group
CLI 范例:
salt '*' group.delete foo
salt.modules.groupadd.
deluser
(name, username, root=None)¶Remove a user from the group.
CLI 范例:
salt '*' group.deluser foo bar
Removes a member user 'bar' from a group 'foo'. If group is not present then returns True.
salt.modules.groupadd.
getent
(refresh=False)¶Return info on all groups
CLI 范例:
salt '*' group.getent
salt.modules.groupadd.
info
(name)¶Return information about a group
CLI 范例:
salt '*' group.info foo
salt.modules.groupadd.
members
(name, members_list, root=None)¶Replaces members of the group with a provided list.
CLI 范例:
salt '*' group.members foo 'user1,user2,user3,...'