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 ---------------------- .../sdc-backend/chef-solo/roles/catalog-be.json | 4 +- .../sdc-frontend/chef-solo/roles/catalog-fe.json | 4 +- 6 files changed, 80 insertions(+), 91 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') 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 diff --git a/sdc-os-chef/sdc-backend/chef-solo/roles/catalog-be.json b/sdc-os-chef/sdc-backend/chef-solo/roles/catalog-be.json index e8928bbdc7..9fc7b8d1dc 100644 --- a/sdc-os-chef/sdc-backend/chef-solo/roles/catalog-be.json +++ b/sdc-os-chef/sdc-backend/chef-solo/roles/catalog-be.json @@ -11,8 +11,8 @@ "chef_type": "role", "run_list": [ "recipe[sdc-catalog-be::BE_1_cleanup_jettydir]", - "recipe[sdc-catalog-be::BE_2_locate_wars]", - "recipe[sdc-catalog-be::BE_4_setup_configuration]", + "recipe[sdc-catalog-be::BE_2_setup_configuration]", + "recipe[sdc-catalog-be::BE_4_jetty_Modules]", "recipe[sdc-catalog-be::BE_5_setup_elasticsearch]", "recipe[sdc-catalog-be::BE_6_setup_portal_properties]", "recipe[sdc-catalog-be::BE_7_logback]", diff --git a/sdc-os-chef/sdc-frontend/chef-solo/roles/catalog-fe.json b/sdc-os-chef/sdc-frontend/chef-solo/roles/catalog-fe.json index 63b55aa712..547c00657c 100644 --- a/sdc-os-chef/sdc-frontend/chef-solo/roles/catalog-fe.json +++ b/sdc-os-chef/sdc-frontend/chef-solo/roles/catalog-fe.json @@ -15,8 +15,8 @@ "recipe[sdc-catalog-fe::FE_3_errors_config]", "recipe[sdc-catalog-fe::FE_4_logback]", "recipe[sdc-catalog-fe::FE_5_rest_configuration]", - "recipe[sdc-catalog-fe::FE_6_create_jetty_modules]", - "recipe[sdc-catalog-fe::FE_7_locate_keystore]" + "recipe[sdc-catalog-fe::FE_7_locate_keystore]", + "recipe[sdc-catalog-fe::FE_6_create_jetty_modules]" ], "env_run_lists": { } -- cgit 1.2.3-korg