summaryrefslogtreecommitdiffstats
path: root/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/2_check_Backend.rb
diff options
context:
space:
mode:
authork.kedron <k.kedron@partner.samsung.com>2020-06-04 10:46:47 +0200
committerk.kedron <k.kedron@partner.samsung.com>2020-06-24 11:16:53 +0200
commitfca8a0b1af32083b8ea025135b120091aec9714f (patch)
tree4bb568ca92ad037801937d1cf2264b4dff923c52 /catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/2_check_Backend.rb
parent7027b33eb41947e6799392d392283b09110158d1 (diff)
Refactoring the check backend, create consumers
Continue refactoring: - added script for healthCheck, create new consumers - also update chef recipes to use new script Issue-ID: SDC-2784 Signed-off-by: Krystian Kedron <k.kedron@partner.samsung.com> Change-Id: I158d816362f91f74b217fe85112cf7c14da8f1ec
Diffstat (limited to 'catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/2_check_Backend.rb')
-rw-r--r--catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/2_check_Backend.rb19
1 files changed, 5 insertions, 14 deletions
diff --git a/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/2_check_Backend.rb b/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/2_check_Backend.rb
index cd36fbd26b..e35caed5b1 100644
--- a/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/2_check_Backend.rb
+++ b/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/2_check_Backend.rb
@@ -1,27 +1,18 @@
if node['disableHttp']
protocol = "https"
+ https_flag = "--https"
be_port = node['BE']['https_port']
else
protocol = "http"
+ https_flag = ""
be_port = node['BE']['http_port']
end
-template "/var/tmp/check_Backend_Health.py" do
- source "check_Backend_Health.py.erb"
- sensitive true
- mode 0755
- variables({
- :protocol => protocol,
- :be_ip => node['Nodes']['BE'],
- :be_port => be_port
- })
-end
-
-bash "executing-check_Backend_Health" do
+bash "executing-check_backend_health" do
code <<-EOH
- python /var/tmp/check_Backend_Health.py
+ sdccheckbackend -i #{node['Nodes']['BE']} -p #{be_port} #{https_flag}
rc=$?
if [[ $rc != 0 ]]; then exit $rc; fi
EOH
- returns [0]
+ returns [0]
end \ No newline at end of file