aboutsummaryrefslogtreecommitdiffstats
path: root/docker/chef-solo/cookbooks/dcae-dt/recipes/jetty_setup.rb
diff options
context:
space:
mode:
authorEran (ev672n), Vosk <ev672n@att.com>2018-08-07 14:15:05 +0300
committerEran (ev672n), Vosk <ev672n@att.com>2018-08-07 14:15:05 +0300
commitb9708a7c3cfaf5767992a2b15180e7b85c459242 (patch)
tree076e19ea52232232e9060a9d7e074947a4a49508 /docker/chef-solo/cookbooks/dcae-dt/recipes/jetty_setup.rb
parentcc32bd38d72e5c1c92048657083952d3e45c1819 (diff)
adding the dcae dt code
Adding DCAE-dt code Change-Id: Id6b779db9d24e10825fb97ad5fd46f41e65e6738 Issue-ID: SDC-1614 Signed-off-by: Eran (ev672n), Vosk <ev672n@att.com>
Diffstat (limited to 'docker/chef-solo/cookbooks/dcae-dt/recipes/jetty_setup.rb')
-rw-r--r--docker/chef-solo/cookbooks/dcae-dt/recipes/jetty_setup.rb86
1 files changed, 86 insertions, 0 deletions
diff --git a/docker/chef-solo/cookbooks/dcae-dt/recipes/jetty_setup.rb b/docker/chef-solo/cookbooks/dcae-dt/recipes/jetty_setup.rb
new file mode 100644
index 0000000..f07f0e9
--- /dev/null
+++ b/docker/chef-solo/cookbooks/dcae-dt/recipes/jetty_setup.rb
@@ -0,0 +1,86 @@
+jetty_base = "#{node['JETTY_BASE']}"
+jetty_home = "#{node['JETTY_HOME']}"
+
+#Set the http module option
+if node['disableHttp']
+ http_option = "#--module=http"
+else
+ http_option = "--module=http"
+end
+
+
+printf("DEBUG: [%s]:[%s] disableHttp=[%s], http_option=[%s] !!! \n", cookbook_name, recipe_name, node['disableHttp'], http_option )
+
+
+directory "Jetty_etcdir_creation" do
+ path "/#{jetty_base}/etc"
+ owner 'jetty'
+ group 'jetty'
+ mode '0755'
+ action :create
+end
+
+
+# Create Keystore
+cookbook_file "#{jetty_base}/etc/keystore" do
+ source "keystore"
+ owner "jetty"
+ group "jetty"
+ mode 0755
+end
+
+# Create Trustore
+cookbook_file "#{jetty_base}/etc/truststore" do
+ source "truststore"
+ owner "jetty"
+ group "jetty"
+ mode 0755
+end
+
+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
+end
+
+# configure Jetty modules
+template "http-ini" do
+ path "#{jetty_base}/start.d/http.ini"
+ source "http-ini.erb"
+ owner "jetty"
+ group "jetty"
+ mode "0755"
+ variables ({
+ :http_option => http_option ,
+ :http_port => "#{node['DCAE']['DT'][:http_port]}"
+ })
+end
+
+template "https-ini" do
+ path "#{jetty_base}/start.d/https.ini"
+ source "https-ini.erb"
+ owner "jetty"
+ group "jetty"
+ mode "0755"
+ variables ({
+ :https_port => "#{node['DCAE']['DT'][:https_port]}"
+ })
+end
+
+template "ssl-ini" do
+ path "#{jetty_base}/start.d/ssl.ini"
+ source "ssl-ini.erb"
+ owner "jetty"
+ group "jetty"
+ mode "0755"
+ variables ({
+ :https_port => "#{node['DCAE']['DT'][:https_port]}" ,
+ :jetty_keystore_pwd => "#{node['jetty'][:keystore_pwd]}" ,
+ :jetty_keymanager_pwd => "#{node['jetty'][:keymanager_pwd]}" ,
+ :jetty_truststore_pwd => "#{node['jetty'][:truststore_pwd]}"
+ })
+end
+