Integrate VNF Repository with SDC
[sdc.git] / sdc-os-chef / sdc-backend / chef-repo / cookbooks / sdc-catalog-be / recipes / BE_2_setup_configuration.rb
1 jetty_base="/var/lib/jetty"
2 replication_factor=1
3
4 template "titan.properties" do
5    path "/#{jetty_base}/config/catalog-be/titan.properties"
6    source "BE-titan.properties.erb"
7    owner "jetty"
8    group "jetty"
9    mode "0755"
10    variables({
11       :CASSANDRA_IP => node['Nodes']['CS'],
12       :CASSANDRA_PWD => node['cassandra'][:cassandra_password],
13       :CASSANDRA_USR => node['cassandra'][:cassandra_user],
14       :rep_factor => replication_factor,
15       :DC_NAME      => node['cassandra'][:cluster_name]+node.chef_environment
16    })
17 end
18
19
20 template "catalog-be-config" do
21    path "/#{jetty_base}/config/catalog-be/configuration.yaml"
22    source "BE-configuration.yaml.erb"
23    owner "jetty"
24    group "jetty"
25    mode "0755"
26    variables({
27       :host_ip      => node['HOST_IP'],
28       :catalog_port => node['BE'][:http_port],
29       :ssl_port     => node['BE'][:https_port],
30       :cassandra_ip => node['Nodes']['CS'],
31       :rep_factor   => 1,
32       :DC_NAME      => node['cassandra'][:cluster_name]+node.chef_environment,
33       :titan_Path   => "/var/lib/jetty/config/catalog-be/"
34    })
35 end
36
37
38 template "distribution-engine-configuration" do
39    path "/#{jetty_base}/config/catalog-be/distribution-engine-configuration.yaml"
40    source "BE-distribution-engine-configuration.yaml.erb"
41    owner "jetty"
42    group "jetty"
43    mode "0755"
44 end
45
46
47 cookbook_file "ArtifactGenerator" do
48    path "/#{jetty_base}/config/catalog-be/Artifact-Generator.properties"
49    source "Artifact-Generator.properties"
50    owner "jetty"
51    group "jetty"
52    mode "0755"
53 end
54
55
56 template "VnfrepoConfiguration" do
57    path "/#{jetty_base}/config/onboarding-be/config-vnfsdk.yaml"
58    source "BE-vnfrepo-configuration.yaml.erb"
59    owner "jetty"
60    group "jetty"
61    mode "0755"
62    variables({
63       :VNFREPO_IP   => node['VnfRepo']['vnfRepoHost'],
64       :VNFREPO_PORT => node['VnfRepo']['vnfRepoPort']
65    })
66 end