Fully HTTPS support in the catalog-be
[sdc.git] / catalog-be / sdc-backend-init / chef-repo / cookbooks / sdc-catalog-be-setup / recipes / 2_check_Backend.rb
index b929637..0a551f2 100644 (file)
@@ -1,16 +1,25 @@
-template "/tmp/check_Backend_Health.py" do
+if node['disableHttp']
+  protocol = "https"
+  be_port = node['BE']['https_port']
+else
+  protocol = "http"
+  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 => node['BE']['http_port']
+      :be_port => be_port
     })
 end
 
-bash "excuting-check_Backend_Health" do
+bash "executing-check_Backend_Health" do
    code <<-EOH
-     python /tmp/check_Backend_Health.py
+     python /var/tmp/check_Backend_Health.py
      rc=$?
      if [[ $rc != 0 ]]; then exit $rc; fi
    EOH