summaryrefslogtreecommitdiffstats
path: root/docker/chef-repo/cookbooks/Deploy-DCAE/recipes/dcae_setup.rb
blob: 0f8ca09417cad9a1f2abe32780aaa8b1a7443ea5 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
dcae_be_vip = node['DCAE_BE_VIP']


if node['disableHttp']
  protocol = "https"
  dcae_be_port = node['DCAE']['BE'][:https_port]
  dcae_fe_port = node['DCAE']['FE'][:https_port]
else
  protocol = "http"
  dcae_be_port = node['DCAE']['BE'][:http_port]
  dcae_fe_port = node['DCAE']['FE'][:http_port]
end


printf("DEBUG: [%s]:[%s] disableHttp=[%s], protocol=[%s], dcae_be_vip=[%s], dcae_be_port=[%s] !!! \n", cookbook_name, recipe_name, node['disableHttp'], protocol, dcae_be_vip ,dcae_be_port )
raise "[ERROR] 'DCAE_BE_FQDN' is not defined" if dcae_be_vip.nil? || dcae_be_vip == ""

directory "DCAE FE_tempdir_creation" do
  path "#{ENV['JETTY_BASE']}/temp"
  owner 'jetty'
  group 'jetty'
  mode '0755'
  action :create
end


directory "#{ENV['JETTY_BASE']}/config" do
  owner "jetty"
  group "jetty"
  mode '0755'
  recursive true
  action :create
end


directory "#{ENV['JETTY_BASE']}/config/dcae-fe" do
  owner "jetty"
  group "jetty"
  mode '0755'
  recursive true
  action :create
end


template "dcae-fe-config" do
  sensitive true
  path "#{ENV['JETTY_BASE']}/config/dcae-fe/application.properties"
  source "dcae-application.properties.erb"
  owner "jetty"
  group "jetty"
  mode "0755"
  variables({
    :dcae_be_vip => dcae_be_vip,
    :dcae_be_port => dcae_be_port,
    :protocol => protocol,
    :dcae_fe_port => dcae_fe_port
  })
end


template "dcae-logback-spring-config" do
  sensitive true
  path "#{ENV['JETTY_BASE']}/config/dcae-fe/logback-spring.xml"
  source "dcae-logback-spring.erb"
  owner "jetty"
  group "jetty"
  mode "0755"
end