def set_role(username, role, **kwargs):
    '''
    Assign role to username.

    username
        Username for role configuration

    role
        Configure role for username

    no_save_config
        If True, don't save configuration commands to startup configuration.
        If False, save configuration to startup configuration.
        Default: False

    .. code-block:: bash

        salt '*' nxos.cmd set_role username=daniel role=vdc-admin.
    '''
    role_line = 'username {0} role {1}'.format(username, role)
    return config(role_line, **kwargs)