def search_template_absent(name):
    '''
    Ensure that the search template is absent

    name
        Name of the search template to remove
    '''

    ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''}

    try:
        template = __salt__['elasticsearch.search_template_get'](id=name)
        if template:
            if __opts__['test']:
                ret['comment'] = 'Search template {0} will be removed'.format(name)
                ret['changes']['old'] = salt.utils.json.loads(template["template"])
                ret['result'] = None
            else:
                ret['result'] = __salt__['elasticsearch.search_template_delete'](id=name)
                if ret['result']:
                    ret['comment'] = 'Successfully removed search template {0}'.format(name)
                    ret['changes']['old'] = salt.utils.json.loads(template["template"])
                else:
                    ret['comment'] = 'Failed to remove search template {0} for unknown reasons'.format(name)
        else:
            ret['comment'] = 'Search template {0} is already absent'.format(name)
    except Exception as err:
        ret['result'] = False
        ret['comment'] = six.text_type(err)

    return ret
Ensure that the search template is absent

    name
        Name of the search template to remove