From b331b88c509df9e8e54530277b741855d1b91d68 Mon Sep 17 00:00:00 2001 From: Idan Amit Date: Tue, 8 Aug 2017 10:32:54 +0300 Subject: [DevOps] - move the keystore copy before the jetty modules creation Change-Id: Ic7d49df2c60ed8385f90c25778ebd4ad747e51e4 Signed-off-by: Idan Amit --- .../sdc-catalog-be/recipes/BE_2_locate_wars.rb | 26 --------- .../recipes/BE_2_setup_configuration.rb | 61 ++++++++++++++++++++++ .../sdc-catalog-be/recipes/BE_4_jetty_Modules.rb | 15 ++++++ .../recipes/BE_4_setup_configuration.rb | 61 ---------------------- 4 files changed, 76 insertions(+), 87 deletions(-) delete mode 100644 sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_2_locate_wars.rb create mode 100644 sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_2_setup_configuration.rb create mode 100644 sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_4_jetty_Modules.rb delete mode 100644 sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_4_setup_configuration.rb (limited to 'sdc-os-chef/sdc-backend/chef-repo') diff --git a/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_2_locate_wars.rb b/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_2_locate_wars.rb deleted file mode 100644 index af3dea15ef..0000000000 --- a/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_2_locate_wars.rb +++ /dev/null @@ -1,26 +0,0 @@ -jetty_base="/var/lib/jetty" -jetty_home="/usr/local/jetty" - -###### create Jetty modules -bash "create-jetty-modules" do -cwd "#{jetty_base}" -code <<-EOH - cd "#{jetty_base}" - java -jar "/#{jetty_home}"/start.jar --add-to-start=deploy - java -jar "/#{jetty_home}"/start.jar --add-to-startd=http,https,logging,setuid -EOH -not_if "ls /#{jetty_base}/start.d/https.ini" -end - -###### copy catalog-be.war - - - -###### copy onboarding-be.war& api-docs.war -#bash "copy-onboarding-be" do -# code <<-EOH -# /bin/tar -xvf /var/tmp/onboarding-be.tar -C /var/tmp/ -# mv /var/tmp/onboarding-be*.war /var/tmp//api-docs*.war #{jetty_base}/webapps -# EOH -#end - diff --git a/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_2_setup_configuration.rb b/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_2_setup_configuration.rb new file mode 100644 index 0000000000..d76e95de1d --- /dev/null +++ b/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_2_setup_configuration.rb @@ -0,0 +1,61 @@ +jetty_base="/var/lib/jetty" +replication_factor=1 + +template "titan.properties" do + path "/#{jetty_base}/config/catalog-be/titan.properties" + source "BE-titan.properties.erb" + owner "jetty" + group "jetty" + mode "0755" + variables({ + :CASSANDRA_IP => node['Nodes']['CS'], + :CASSANDRA_PWD => node['cassandra'][:cassandra_password], + :CASSANDRA_USR => node['cassandra'][:cassandra_user], + :rep_factor => replication_factor, + :DC_NAME => node['cassandra'][:cluster_name]+node.chef_environment + }) +end + + +template "catalog-be-config" do + path "/#{jetty_base}/config/catalog-be/configuration.yaml" + source "BE-configuration.yaml.erb" + owner "jetty" + group "jetty" + mode "0755" + variables({ + :host_ip => node['HOST_IP'], + :catalog_port => node['BE'][:http_port], + :ssl_port => node['BE'][:https_port], + :cassandra_ip => node['Nodes']['CS'], + :rep_factor => 1, + :DC_NAME => node['cassandra'][:cluster_name]+node.chef_environment, + :titan_Path => "/var/lib/jetty/config/catalog-be/" + }) +end + + +template "distribution-engine-configuration" do + path "/#{jetty_base}/config/catalog-be/distribution-engine-configuration.yaml" + source "BE-distribution-engine-configuration.yaml.erb" + owner "jetty" + group "jetty" + mode "0755" +end + + +cookbook_file "ArtifactGenerator" do + path "/#{jetty_base}/config/catalog-be/Artifact-Generator.properties" + source "Artifact-Generator.properties" + owner "jetty" + group "jetty" + mode "0755" +end + + +cookbook_file "/#{jetty_base}/etc/keystore" do + source "keystore" + owner "jetty" + group "jetty" + mode 0755 +end diff --git a/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_4_jetty_Modules.rb b/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_4_jetty_Modules.rb new file mode 100644 index 0000000000..3ec16e8924 --- /dev/null +++ b/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_4_jetty_Modules.rb @@ -0,0 +1,15 @@ +jetty_base="/var/lib/jetty" +jetty_home="/usr/local/jetty" + +###### create Jetty modules +bash "create-jetty-modules" do +cwd "#{jetty_base}" +code <<-EOH + cd "#{jetty_base}" + java -jar "/#{jetty_home}"/start.jar --add-to-start=deploy + java -jar "/#{jetty_home}"/start.jar --add-to-startd=http,https,logging,setuid +EOH +not_if "ls /#{jetty_base}/start.d/https.ini" +end + + diff --git a/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_4_setup_configuration.rb b/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_4_setup_configuration.rb deleted file mode 100644 index d76e95de1d..0000000000 --- a/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_4_setup_configuration.rb +++ /dev/null @@ -1,61 +0,0 @@ -jetty_base="/var/lib/jetty" -replication_factor=1 - -template "titan.properties" do - path "/#{jetty_base}/config/catalog-be/titan.properties" - source "BE-titan.properties.erb" - owner "jetty" - group "jetty" - mode "0755" - variables({ - :CASSANDRA_IP => node['Nodes']['CS'], - :CASSANDRA_PWD => node['cassandra'][:cassandra_password], - :CASSANDRA_USR => node['cassandra'][:cassandra_user], - :rep_factor => replication_factor, - :DC_NAME => node['cassandra'][:cluster_name]+node.chef_environment - }) -end - - -template "catalog-be-config" do - path "/#{jetty_base}/config/catalog-be/configuration.yaml" - source "BE-configuration.yaml.erb" - owner "jetty" - group "jetty" - mode "0755" - variables({ - :host_ip => node['HOST_IP'], - :catalog_port => node['BE'][:http_port], - :ssl_port => node['BE'][:https_port], - :cassandra_ip => node['Nodes']['CS'], - :rep_factor => 1, - :DC_NAME => node['cassandra'][:cluster_name]+node.chef_environment, - :titan_Path => "/var/lib/jetty/config/catalog-be/" - }) -end - - -template "distribution-engine-configuration" do - path "/#{jetty_base}/config/catalog-be/distribution-engine-configuration.yaml" - source "BE-distribution-engine-configuration.yaml.erb" - owner "jetty" - group "jetty" - mode "0755" -end - - -cookbook_file "ArtifactGenerator" do - path "/#{jetty_base}/config/catalog-be/Artifact-Generator.properties" - source "Artifact-Generator.properties" - owner "jetty" - group "jetty" - mode "0755" -end - - -cookbook_file "/#{jetty_base}/etc/keystore" do - source "keystore" - owner "jetty" - group "jetty" - mode 0755 -end -- cgit 1.2.3-korg