Ensure an service exists and is up-to-date

    name
        Name of the group

    type
        Service type

    enabled
        Boolean to control if service is enabled

    description
        An arbitrary description of the service

def present(name, auth=None, **kwargs):
    '''
    Ensure an service exists and is up-to-date

    name
        Name of the group

    type
        Service type

    enabled
        Boolean to control if service is enabled

    description
        An arbitrary description of the service
    '''
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': ''}

    kwargs = __utils__['args.clean_kwargs'](**kwargs)

    __salt__['keystoneng.setup_clouds'](auth)

    service = __salt__['keystoneng.service_get'](name=name)

    if service is None:
        if __opts__['test'] is True:
            ret['result'] = None
            ret['changes'] = kwargs
            ret['comment'] = 'Service will be created.'
            return ret

        kwargs['name'] = name
        service = __salt__['keystoneng.service_create'](**kwargs)
        ret['changes'] = service
        ret['comment'] = 'Created service'
        return ret

    changes = __salt__['keystoneng.compare_changes'](service, **kwargs)
    if changes:
        if __opts__['test'] is True:
            ret['result'] = None
            ret['changes'] = changes
            ret['comment'] = 'Service will be updated.'
            return ret

        kwargs['name'] = service
        __salt__['keystoneng.service_update'](**kwargs)
        ret['changes'].update(changes)
        ret['comment'] = 'Updated service'

    return ret