def members(name, members_list, root=None):
    on_redhat_5 = __grains__.get('os_family') == 'RedHat' and __grains__.get('osmajorrelease') == '5'

    if __grains__['kernel'] == 'Linux':
        if on_redhat_5:
            cmd = ('gpasswd', '-M', members_list, name)
        else:
            cmd = ('gpasswd', '--members', members_list, name)
        if root is not None:
            cmd.extend(('-R', root))
        retcode = __salt__['cmd.retcode'](cmd, python_shell=False)
    elif __grains__['kernel'] == 'OpenBSD':
        retcode = 1
        grp_info = __salt__['group.info'](name)
        if grp_info and name in grp_info['name']:
            __salt__['cmd.run']('groupdel {0}'.format(name),
                                python_shell=False)
            __salt__['cmd.run']('groupadd -g {0} {1}'.format(
                grp_info['gid'], name), python_shell=False)
            for user in members_list.split(","):
                if user:
                    retcode = __salt__['cmd.retcode'](
                        'usermod -G {0} {1}'.format(name, user),
                        python_shell=False)
                    if not retcode == 0:
                        break
                # provided list is '': users previously deleted from group
                else:
                    retcode = 0
    else:
        log.error('group.members is not yet supported on this platform')
        return False

    return not retcode
Replaces members of the group with a provided list.
dataset/ETHPy150Open saltstack/salt/salt/modules/groupadd.py/members