aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_4_jetty_Modules.rb
blob: 34934a44af1e304538e4f6b1bbdb1c8eaa7ff697 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#Set the http module option
if node['disableHttp']
  http_option = "#--module=http"
else
  http_option = "--module=http"
end


bash "create-jetty-modules" do
cwd "#{ENV['JETTY_BASE']}"
code <<-EOH
  cd "#{ENV['JETTY_BASE']}"
  java -jar "#{ENV['JETTY_HOME']}"/start.jar --add-to-start=deploy
  java -jar "#{ENV['JETTY_HOME']}"/start.jar --create-startd --add-to-start=http,https,console-capture,setuid
EOH
end


template "http-ini" do
  path "#{ENV['JETTY_BASE']}/start.d/http.ini"
  source "http-ini.erb"
  owner "jetty"
  group "jetty"
  mode "0755"
  variables ({
    :http_option => http_option ,
    :http_port => "#{node['BE'][:http_port]}"
  })
   
end


template "https-ini" do
  path "#{ENV['JETTY_BASE']}/start.d/https.ini"
  source "https-ini.erb"
  owner "jetty"
  group "jetty"
  mode "0755"
  variables :https_port => "#{node['BE'][:https_port]}"
end


template "ssl-ini" do
  path "#{ENV['JETTY_BASE']}/start.d/ssl.ini"
  source "ssl-ini.erb"
  owner "jetty"
  group "jetty"
  mode "0755"
  variables ({
    :https_port => "#{node['BE'][:https_port]}" ,
    :jetty_keystore_pwd => "#{node['jetty'][:keystore_pwd]}" ,
    :jetty_keymanager_pwd => "#{node['jetty'][:keymanager_pwd]}" ,
    :jetty_truststore_pwd => "#{node['jetty'][:truststore_pwd]}"
  })
end