summaryrefslogtreecommitdiffstats
path: root/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes
diff options
context:
space:
mode:
authorys9693 <ys9693@att.com>2020-01-19 13:50:02 +0200
committerOfir Sonsino <ofir.sonsino@intl.att.com>2020-01-22 12:33:31 +0000
commit16a9fce0e104a38371a9e5a567ec611ae3fc7f33 (patch)
tree03a2aff3060ddb5bc26a90115805a04becbaffc9 /catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes
parentaa83a2da4f911c3ac89318b8e9e8403b072942e1 (diff)
Catalog alignment
Issue-ID: SDC-2724 Signed-off-by: ys9693 <ys9693@att.com> Change-Id: I52b4aacb58cbd432ca0e1ff7ff1f7dd52099c6fe
Diffstat (limited to 'catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes')
-rw-r--r--catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_10_setup_cadi.rb85
-rw-r--r--catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_2_setup_configuration.rb7
2 files changed, 91 insertions, 1 deletions
diff --git a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_10_setup_cadi.rb b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_10_setup_cadi.rb
new file mode 100644
index 0000000000..b06f8a5342
--- /dev/null
+++ b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_10_setup_cadi.rb
@@ -0,0 +1,85 @@
+jetty_base = "#{ENV['JETTY_BASE']}"
+
+
+directory "Jetty_etc_dir_creation" do
+ path "#{jetty_base}/etc"
+ owner 'jetty'
+ group 'jetty'
+ mode '0755'
+ action :create
+ not_if { ::File.directory?("#{jetty_base}/etc") }
+end
+
+
+cookbook_file "#{jetty_base}/etc/keyfile" do
+ source "keyfile"
+ owner "jetty"
+ group "jetty"
+ mode 0755
+end
+
+
+cookbook_file "#{jetty_base}/etc/cadi_truststore.jks" do
+ source "cadi_truststore.jks"
+ owner "jetty"
+ group "jetty"
+ mode 0755
+end
+
+
+template "#{jetty_base}/etc/cadi.properties" do
+ path "#{jetty_base}/etc/cadi.properties"
+ source "cadi.properties.erb"
+ owner "jetty"
+ group "jetty"
+ mode "0755"
+end
+
+
+#Workaround due to hardcode definition in cata,log-be web.xml file
+directory "/opt/app/jetty" do
+ path "/opt/app/jetty"
+ owner 'jetty'
+ group 'jetty'
+ mode '0755'
+ recursive true
+ action :create
+end
+
+directory "/opt/app/jetty/base/" do
+ path "/opt/app/jetty/base/"
+ owner 'jetty'
+ group 'jetty'
+ mode '0755'
+ recursive true
+ action :create
+end
+
+
+directory "/opt/app/jetty/base/be/" do
+ path "/opt/app/jetty/base/be/"
+ owner 'jetty'
+ group 'jetty'
+ mode '0755'
+ recursive true
+ action :create
+end
+
+directory "/opt/app/jetty/base/be/etc" do
+ path "/opt/app/jetty/base/be/etc"
+ owner 'jetty'
+ group 'jetty'
+ mode '0755'
+ recursive true
+ action :create
+end
+
+#Workaround due to hardcode definition in catalog-be web.xml file
+template "/opt/app/jetty/base/be/etc/cadi.properties" do
+ path "/opt/app/jetty/base/be/etc/cadi.properties"
+ source "cadi.properties.erb"
+ owner "jetty"
+ group "jetty"
+ mode "0755"
+end
+
diff --git a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_2_setup_configuration.rb b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_2_setup_configuration.rb
index 6f455fc6f3..a0a6bc06d4 100644
--- a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_2_setup_configuration.rb
+++ b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/recipes/BE_2_setup_configuration.rb
@@ -10,6 +10,11 @@ else
end
+#Set random ID for DMaap configuration
+if node['DMAAP']['random_id'].nil?
+ node.default['DMAAP']['random_id'] = Time.now.getutc.to_i
+end
+
template "janusgraph.properties" do
path "#{ENV['JETTY_BASE']}/config/catalog-be/janusgraph.properties"
@@ -54,7 +59,7 @@ template "catalog-be-config" do
:cassandra_truststore_password => node['cassandra'][:truststore_password],
:cassandra_ssl_enabled => "#{ENV['cassandra_ssl_enabled']}",
:dcae_be_vip => node['DCAE_BE_VIP'],
- :dmaap_active => node['DMAAP']['active']
+ :dmaap_active => node['DMAAP']['active']
})
end