summaryrefslogtreecommitdiffstats
path: root/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes
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
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')
-rw-r--r--catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/1_create_consumer_and_user.rb19
-rw-r--r--catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/2_check_Backend.rb19
-rw-r--r--catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/3_import_Normatives.rb1
3 files changed, 11 insertions, 28 deletions
diff --git a/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/1_create_consumer_and_user.rb b/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/1_create_consumer_and_user.rb
index bf8065b079..68cfcab6ea 100644
--- a/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/1_create_consumer_and_user.rb
+++ b/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/1_create_consumer_and_user.rb
@@ -15,29 +15,20 @@ else
user_conf_dir = ""
end
-bash "executing-create_user" do
+bash "executing-create_users" do
code <<-EOH
sdcuserinit -i #{node['Nodes']['BE']} -p #{be_port} #{user_conf_dir} #{https_flag}
rc=$?
if [[ $rc != 0 ]]; then exit $rc; fi
EOH
+ returns [0]
end
-template "/var/tmp/consumers.py" do
- source "consumers.py.erb"
- sensitive true
- mode 0755
- variables({
- :protocol => protocol,
- :be_ip => node['Nodes']['BE'],
- :be_port => be_port
- })
-end
-
-bash "executing-consumers" do
+bash "executing-create_consumers" do
code <<-EOH
- python /var/tmp/consumers.py
+ sdcconsumerinit -i #{node['Nodes']['BE']} -p #{be_port} #{https_flag}
rc=$?
if [[ $rc != 0 ]]; then exit $rc; fi
EOH
+ returns [0]
end
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
diff --git a/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/3_import_Normatives.rb b/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/3_import_Normatives.rb
index f59d91693d..79f880b146 100644
--- a/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/3_import_Normatives.rb
+++ b/catalog-be/sdc-backend-init/chef-repo/cookbooks/sdc-catalog-be-setup/recipes/3_import_Normatives.rb
@@ -46,4 +46,5 @@ bash "executing-import_Normatives" do
if [[ $rc != 0 ]]; then exit $rc; fi
fi
EOH
+ returns [0]
end