summaryrefslogtreecommitdiffstats
path: root/docker/docker_tools/chef-repo/cookbooks/Deploy-DCAE/recipes/dcae_tools_setup.rb
blob: a9892015d5934a7d524cd68b2532af343439e70c (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
dcae_be_host = node['DCAE_BE_VIP']

if node['disableHttp']
  protocol = "https"
  dcae_be_port = node['DCAE']['BE'][:https_port]
else
  protocol = "http"
  dcae_be_port = node['DCAE']['BE'][: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_host ,dcae_be_port )

directory "Jetty_etc dir_creation" do
  path "#{ENV['JETTY_BASE']}/etc"
  owner 'jetty'
  group 'jetty'
  mode '0755'
  action :create
end


cookbook_file "#{ENV['JETTY_BASE']}/etc/org.onap.sdc.trust.jks" do
  source "org.onap.sdc.trust.jks"
  owner "jetty"
  group "jetty"
  mode 0755
end


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


template "dcae-tools-config-yaml" do
  sensitive true
  path "/#{ENV['JETTY_BASE']}/conf/environment.json"
  source "environment.json.erb"
  mode "0755"
  owner "jetty"
  group "jetty"
  variables({
    :dcae_be_host => dcae_be_host,
    :dcae_be_port => dcae_be_port,
    :protocol => protocol
  })
end


cookbook_file "/#{ENV['JETTY_BASE']}/conf/config.json" do
  sensitive true
  source "config.json"
  owner "jetty"
  group "jetty"
  mode "0755"
  action :create
end