def index_template_create(name, body, hosts=None, profile=None):
 es = _get_instance(hosts, profile)
 try:
  result = es.indices.put_template(name=name, body=body)
  return True
 except elasticsearch.exceptions.NotFoundError:
  return None
 return None

def index_template_create ( name , body , hosts = None , profile = None ) : es = _get_instance ( hosts , profile ) try : result = es . indices . put_template ( name = name , body = body ) return True except elasticsearch . exceptions . NotFoundError : return None return None
create an index template cli example:: salt myminion elasticsearch .