upgrading jetty
[sdc.git] / catalog-fe / sdc-frontend / chef-repo / cookbooks / sdc-catalog-fe / recipes / FE_7_create_jetty_modules.rb
1 #
2 #Set the http module option
3 if node['disableHttp']
4   http_option = "#--module=http"
5 else
6   http_option = "--module=http"
7 end
8
9
10 bash "create-jetty-modules" do
11 cwd "#{ENV['JETTY_BASE']}"
12 code <<-EOH
13    cd "#{ENV['JETTY_BASE']}"
14    java -jar "#{ENV['JETTY_HOME']}"/start.jar --add-to-start=deploy
15    java -jar "#{ENV['JETTY_HOME']}"/start.jar --create-startd --add-to-start=http,https,console-capture,setuid
16 EOH
17 end
18
19
20 template "http-ini" do
21    path "#{ENV['JETTY_BASE']}/start.d/http.ini"
22    source "http-ini.erb"
23    owner "jetty"
24    group "jetty"
25    mode "0755"
26    variables ({
27      :http_option => http_option ,
28      :http_port => "#{node['FE'][:http_port]}"
29     })
30 end
31
32
33 template "https-ini" do
34    path "#{ENV['JETTY_BASE']}/start.d/https.ini"
35    source "https-ini.erb"
36    owner "jetty"
37    group "jetty"
38    mode "0755"
39    variables :https_port => "#{node['FE'][:https_port]}"
40 end
41
42
43 template "ssl-ini" do
44    path "#{ENV['JETTY_BASE']}/start.d/ssl.ini"
45    source "ssl-ini.erb"
46    owner "jetty"
47    group "jetty"
48    mode "0755"
49    variables ({
50      :https_port => "#{node['FE'][:https_port]}" ,
51      :jetty_keystore_pwd => "#{node['jetty'][:keystore_pwd]}" ,
52      :jetty_keymanager_pwd => "#{node['jetty'][:keymanager_pwd]}" ,
53      :jetty_truststore_pwd => "#{node['jetty'][:truststore_pwd]}"
54    })
55 end