Add the specified group

    name
        Name of the new group

    gid
        Use GID for the new group

    system
        Create a system account

    root
        Directory to chroot into

    CLI Example:

    .. code-block:: bash

        salt '*' group.add foo 3456

def add(name, gid=None, system=False, root=None):
    '''
    Add the specified group

    name
        Name of the new group

    gid
        Use GID for the new group

    system
        Create a system account

    root
        Directory to chroot into

    CLI Example:

    .. code-block:: bash

        salt '*' group.add foo 3456
    '''
    cmd = ['groupadd']
    if gid:
        cmd.append('-g {0}'.format(gid))
    if system and __grains__['kernel'] != 'OpenBSD':
        cmd.append('-r')

    if root is not None:
        cmd.extend(('-R', root))

    cmd.append(name)

    ret = __salt__['cmd.run_all'](cmd, python_shell=False)

    return not ret['retcode']