X-Git-Url: https://gerrit.mcp.mirantis.com/gitweb?p=salt-formulas%2Felasticsearch.git;a=blobdiff_plain;f=elasticsearch%2Fclient%2Finit.sls;h=18f4ffc49d7b462910c882d8b99527f8f79bdaf8;hp=cd6f2fa58408281b0e23d3692d2a19b13cb48b33;hb=f9ede3488d97b79439c0d04a847db14d750b8f6b;hpb=82034f9a64eccc3bab5c86eb79c45d2dcbd93087 diff --git a/elasticsearch/client/init.sls b/elasticsearch/client/init.sls index cd6f2fa..18f4ffc 100644 --- a/elasticsearch/client/init.sls +++ b/elasticsearch/client/init.sls @@ -13,6 +13,17 @@ include: {%- endif %} {%- for index_name, index in client.get('index', {}).iteritems() %} +# TODO: "Replace with module.run when bug is fixed". +# Since bug in retry logic in salt (#49895) we need to use a workaround for now. +elasticsearch_check_cluster_status_before_creating_index_{{ index_name }}: + cmd.run: + - name: curl -sf {{ client.server.host }}:{{ client.server.port }}/_cat/health | awk '{print $4}' | grep green + - retry: + attempts: 5 + until: True + interval: 10 + splay: 5 + elasticsearch_index_{{ index_name }}: {%- if index.get('enabled', False) %}