aboutsummaryrefslogtreecommitdiffstats
path: root/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_2_setup_configuration.rb
blob: e9a00c3d95e742e2b063798c7d5d744daa0c9f92 (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
jetty_base="/var/lib/jetty"
replication_factor=1

template "titan.properties" do
   path "/#{jetty_base}/config/catalog-be/titan.properties"
   source "BE-titan.properties.erb"
   owner "jetty"
   group "jetty"
   mode "0755"
   variables({
      :CASSANDRA_IP => node['Nodes']['CS'],
      :CASSANDRA_PWD => node['cassandra'][:cassandra_password],
      :CASSANDRA_USR => node['cassandra'][:cassandra_user],
      :rep_factor => replication_factor,
      :DC_NAME      => node['cassandra'][:cluster_name]+node.chef_environment
   })
end


template "catalog-be-config" do
   path "/#{jetty_base}/config/catalog-be/configuration.yaml"
   source "BE-configuration.yaml.erb"
   owner "jetty"
   group "jetty"
   mode "0755"
   variables({
      :host_ip      => node['HOST_IP'],
      :catalog_port => node['BE'][:http_port],
      :ssl_port     => node['BE'][:https_port],
      :cassandra_ip => node['Nodes']['CS'],
      :rep_factor   => 1,
      :DC_NAME      => node['cassandra'][:cluster_name]+node.chef_environment,
      :titan_Path   => "/var/lib/jetty/config/catalog-be/"
   })
end


template "distribution-engine-configuration" do
   path "/#{jetty_base}/config/catalog-be/distribution-engine-configuration.yaml"
   source "BE-distribution-engine-configuration.yaml.erb"
   owner "jetty"
   group "jetty"
   mode "0755"
end


cookbook_file "ArtifactGenerator" do
   path "/#{jetty_base}/config/catalog-be/Artifact-Generator.properties"
   source "Artifact-Generator.properties"
   owner "jetty"
   group "jetty"
   mode "0755"
end


template "VnfrepoConfiguration" do
   path "/#{jetty_base}/config/onboarding-be/config-vnfsdk.yaml"
   source "BE-vnfrepo-configuration.yaml.erb"
   owner "jetty"
   group "jetty"
   mode "0755"
   variables({
      :VNFREPO_IP   => node['VnfRepo']['vnfRepoHost'],
      :VNFREPO_PORT => node['VnfRepo']['vnfRepoPort']
   })
end