summaryrefslogtreecommitdiffstats
path: root/sdc-os-chef/sdc-elasticsearch
diff options
context:
space:
mode:
Diffstat (limited to 'sdc-os-chef/sdc-elasticsearch')
-rw-r--r--sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/recipes/ES_3_prepareProbeFile.rb5
-rw-r--r--sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/templates/default/ready-probe.sh.erb8
-rw-r--r--sdc-os-chef/sdc-elasticsearch/chef-solo/roles/elasticsearch.json3
3 files changed, 15 insertions, 1 deletions
diff --git a/sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/recipes/ES_3_prepareProbeFile.rb b/sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/recipes/ES_3_prepareProbeFile.rb
new file mode 100644
index 0000000000..14d08be94c
--- /dev/null
+++ b/sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/recipes/ES_3_prepareProbeFile.rb
@@ -0,0 +1,5 @@
+template "/var/lib/ready-probe.sh" do
+ source "ready-probe.sh.erb"
+ sensitive true
+ mode 0755
+end \ No newline at end of file
diff --git a/sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/templates/default/ready-probe.sh.erb b/sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/templates/default/ready-probe.sh.erb
new file mode 100644
index 0000000000..66b07873e5
--- /dev/null
+++ b/sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/templates/default/ready-probe.sh.erb
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+health_Check_http_code=$(curl -o /dev/null -w '%{http_code}' http://127.0.0.1:9200/_cluster/health?wait_for_status=yellow&timeout=120s)
+if [[ "$health_Check_http_code" -eq 200 ]]; then
+ exit 200
+else
+ exit $health_Check_http_code
+fi
diff --git a/sdc-os-chef/sdc-elasticsearch/chef-solo/roles/elasticsearch.json b/sdc-os-chef/sdc-elasticsearch/chef-solo/roles/elasticsearch.json
index 239c1cd04b..8e11b2246e 100644
--- a/sdc-os-chef/sdc-elasticsearch/chef-solo/roles/elasticsearch.json
+++ b/sdc-os-chef/sdc-elasticsearch/chef-solo/roles/elasticsearch.json
@@ -11,7 +11,8 @@
"chef_type": "role",
"run_list": [
"recipe[sdc-elasticsearch::ES_1_setup_elasticsearch]",
- "recipe[sdc-elasticsearch::ES_2_setup_logging]"
+ "recipe[sdc-elasticsearch::ES_2_setup_logging]",
+ "recipe[sdc-elasticsearch::ES_3_prepareProbeFile]"
],
"env_run_lists": {
}