X-Git-Url: https://gerrit.mcp.mirantis.com/gitweb?p=salt-formulas%2Felasticsearch.git;a=blobdiff_plain;f=elasticsearch%2Fclient%2Finit.sls;h=065bde148ca09e1b0f0a006444a0a107cca8e8e0;hp=18f4ffc49d7b462910c882d8b99527f8f79bdaf8;hb=8c207eaf594db1a33c230b261541f7890aec5746;hpb=2f74007e592ad51467a93a312c6ed41dfd46a1a0 diff --git a/elasticsearch/client/init.sls b/elasticsearch/client/init.sls index 18f4ffc..065bde1 100644 --- a/elasticsearch/client/init.sls +++ b/elasticsearch/client/init.sls @@ -27,7 +27,7 @@ elasticsearch_check_cluster_status_before_creating_index_{{ index_name }}: elasticsearch_index_{{ index_name }}: {%- if index.get('enabled', False) %} - {% set operation = 'create' %} + {% set operation = 'present' %} {%- if index.definition is defined %} {% set definition = index.definition %} @@ -67,14 +67,8 @@ elasticsearch_index_{{ index_name }}: {%- if index.get('force_operation', False) %} elasticsearch_index_{{ index_name }}_{{ operation }}: {% set curdate = None | strftime('%Y.%m.%d') %} - module.run: - - name: elasticsearch.index_{{ operation }} - - index: {{ index_name }}-{{ curdate }} -{%- else %} -elasticsearch_index_{{ index_name }}_{{ operation }}: - module.run: - - name: elasticsearch.index_{{ operation }} - - index: {{ index_name }} + elasticsearch.index_{{ operation }}: + - name: {{ index_name }}-{{ curdate }} {%- endif %} {%- endfor %}