aboutsummaryrefslogtreecommitdiffstats
path: root/recipes
diff options
context:
space:
mode:
Diffstat (limited to 'recipes')
-rw-r--r--recipes/apih.rb9
-rw-r--r--recipes/bpmn.rb6
-rw-r--r--recipes/createConfigDirectories.rb25
-rw-r--r--recipes/default.rb8
-rw-r--r--recipes/jra.rb9
-rw-r--r--recipes/mso-api-handler-infra-config.rb34
-rw-r--r--recipes/mso-appc-adapter-config.rb37
-rw-r--r--recipes/mso-asdc-controller-config.rb63
-rw-r--r--recipes/mso-bpmn-config.rb49
-rw-r--r--recipes/mso-po-adapter-config.rb37
-rw-r--r--recipes/mso-requests-db-adapter-config.rb23
-rw-r--r--recipes/mso-sdnc-adapter-config.rb37
-rw-r--r--recipes/mso-topology-config.rb14
13 files changed, 351 insertions, 0 deletions
diff --git a/recipes/apih.rb b/recipes/apih.rb
new file mode 100644
index 0000000..1bd000d
--- /dev/null
+++ b/recipes/apih.rb
@@ -0,0 +1,9 @@
+################
+# Deploy apih config set
+#
+######
+include_recipe "mso-config::mso-api-handler-infra-config"
+include_recipe "mso-config::mso-asdc-controller-config"
+include_recipe "mso-config::mso-requests-db-adapter-config"
+include_recipe "mso-config::mso-topology-config"
+
diff --git a/recipes/bpmn.rb b/recipes/bpmn.rb
new file mode 100644
index 0000000..94bb5f7
--- /dev/null
+++ b/recipes/bpmn.rb
@@ -0,0 +1,6 @@
+################
+# Deploy bpmn config set
+#
+######
+include_recipe "mso-config::mso-bpmn-config"
+
diff --git a/recipes/createConfigDirectories.rb b/recipes/createConfigDirectories.rb
new file mode 100644
index 0000000..a983b02
--- /dev/null
+++ b/recipes/createConfigDirectories.rb
@@ -0,0 +1,25 @@
+#####################################
+# create directories
+# /opt/mso/etc/[..]
+# /opt/mso/etc/mso/[..]
+# /opt/mso/etc/mso/config/[..]
+#####################################
+["#{node['mso_config_path']}"].each do |path|
+ directory path do
+ owner "jboss"
+ group "jboss"
+ mode "0755"
+ recursive true
+ action :create
+ end
+end
+
+
+directory "#{node['mso_config_path']}" do
+ owner 'jboss'
+ group 'jboss'
+ mode '0755'
+ recursive true
+ action :create
+end
+
diff --git a/recipes/default.rb b/recipes/default.rb
new file mode 100644
index 0000000..73df902
--- /dev/null
+++ b/recipes/default.rb
@@ -0,0 +1,8 @@
+#
+# Cookbook Name:: mso-config
+# Recipe:: default
+#
+# Copyright 2016, YOUR_COMPANY_NAME
+#
+# All rights reserved - Do Not Redistribute
+#
diff --git a/recipes/jra.rb b/recipes/jra.rb
new file mode 100644
index 0000000..da46ee2
--- /dev/null
+++ b/recipes/jra.rb
@@ -0,0 +1,9 @@
+################
+# Deploy jra config set
+#
+######
+include_recipe "mso-config::mso-sdnc-adapter-config"
+include_recipe "mso-config::mso-po-adapter-config"
+include_recipe "mso-config::mso-topology-config"
+include_recipe "mso-config::mso-appc-adapter-config"
+
diff --git a/recipes/mso-api-handler-infra-config.rb b/recipes/mso-api-handler-infra-config.rb
new file mode 100644
index 0000000..6858c75
--- /dev/null
+++ b/recipes/mso-api-handler-infra-config.rb
@@ -0,0 +1,34 @@
+################
+#
+######
+include_recipe 'mso-config::createConfigDirectories'
+
+################
+#
+######
+['mso.apihandler-infra.properties'].each do |file|
+ template "#{node['mso_config_path']}#{file}" do
+ source "mso-api-handler-infra-config/#{file}"
+ owner "jboss"
+ group "jboss"
+ mode "0744"
+ variables(
+ :var => node["mso-api-handler-infra-config"]
+ )
+ end
+end
+
+remote_directory "#{node['mso_config_path']}" do
+ source "mso-api-handler-infra-config"
+ #cookbook "default is current"
+ files_mode "0744"
+ files_owner "jboss"
+ files_group "jboss"
+ mode "0755"
+ owner "jboss"
+ group "jboss"
+ overwrite true
+ recursive true
+ action :create
+end
+
diff --git a/recipes/mso-appc-adapter-config.rb b/recipes/mso-appc-adapter-config.rb
new file mode 100644
index 0000000..3dd67d7
--- /dev/null
+++ b/recipes/mso-appc-adapter-config.rb
@@ -0,0 +1,37 @@
+################
+#
+######
+include_recipe 'mso-config::createConfigDirectories'
+
+################
+#
+######
+['mso.appc-adapter.properties'].each do |file|
+ template "#{node['mso_config_path']}#{file}" do
+ source "mso-appc-adapter-config/#{file}"
+ owner "jboss"
+ group "jboss"
+ mode "0744"
+ variables(
+ :appc_vars => node["mso-appc-adapter-config"]
+ )
+ end
+end
+
+################
+#
+######
+remote_directory "#{node['mso_config_path']}" do
+ source "mso-appc-adapter-config"
+ #cookbook "default is current"
+ files_mode "0744"
+ files_owner "jboss"
+ files_group "jboss"
+ mode "0755"
+ owner "jboss"
+ group "jboss"
+ overwrite true
+ recursive true
+ action :create
+end
+
diff --git a/recipes/mso-asdc-controller-config.rb b/recipes/mso-asdc-controller-config.rb
new file mode 100644
index 0000000..0d84dec
--- /dev/null
+++ b/recipes/mso-asdc-controller-config.rb
@@ -0,0 +1,63 @@
+################
+#
+######
+include_recipe 'mso-config::createConfigDirectories'
+
+################
+#
+######
+
+if !node.attribute?("asdc-connections")
+ abort "ASDC connections not defined!\n"
+end
+
+ruby_block 'replace_consumer_group_in_asdc_json' do
+ block do
+
+ asdc_connections_reworked = Hash.new
+
+ node["asdc-connections"].each do | asdc_name, asdc_config |
+
+ asdc_client_configs = Hash.new
+ asdc_config.each do | config_name, config_value |
+
+ if "#{config_name}" == "consumerGroup" or "#{config_name}" == "consumerId"
+ asdc_client_configs[config_name] = "#{config_value}-#{node.chef_environment}#{node['hostname'][-1]}"
+ else
+ asdc_client_configs[config_name] = "#{config_value}"
+ end
+ end
+
+ asdc_connections_reworked[asdc_name] = asdc_client_configs
+ end
+
+ r = resources(template: 'mso_asdc_json')
+ r.variables(
+ :allAsdcConnections => asdc_connections_reworked
+ )
+ end
+ notifies :create, 'template[mso_asdc_json]', :immediately
+end
+
+template "mso_asdc_json" do
+ path "#{ node['mso_config_path'] }/mso.asdc.json"
+ source "mso-asdc-controller-config/mso.asdc.json"
+ owner "jboss"
+ group "jboss"
+ mode "0744"
+ action :nothing
+end
+
+remote_directory "#{node['mso_config_path']}" do
+ source "mso-asdc-controller-config"
+ #cookbook "default is current"
+ files_mode "0744"
+ files_owner "jboss"
+ files_group "jboss"
+ mode "0755"
+ owner "jboss"
+ group "jboss"
+ overwrite true
+ recursive true
+ action :create
+end
diff --git a/recipes/mso-bpmn-config.rb b/recipes/mso-bpmn-config.rb
new file mode 100644
index 0000000..3f66057
--- /dev/null
+++ b/recipes/mso-bpmn-config.rb
@@ -0,0 +1,49 @@
+################
+#
+######
+include_recipe 'mso-config::createConfigDirectories'
+
+################
+#
+######
+['mso.bpmn.properties'].each do |file|
+ template "#{node['mso_config_path']}#{file}" do
+ source "mso-bpmn-config/#{file}"
+ owner "jboss"
+ group "jboss"
+ mode "0744"
+ variables(
+ :urnFileSystemLoadingEnabled => node["mso-bpmn-config"]["urnFileSystemLoadingEnabled"],
+ )
+ end
+end
+
+################
+#
+######
+['mso.bpmn.urn.properties'].each do |file|
+ template "#{node['mso_config_path']}#{file}" do
+ source "mso-bpmn-config/#{file}"
+ owner "jboss"
+ group "jboss"
+ mode "0744"
+ variables(
+ :var => node["mso-bpmn-urn-config"],
+ :envname => node.chef_environment
+ )
+ end
+end
+
+remote_directory "#{node['mso_config_path']}" do
+ source "mso-bpmn-config"
+ #cookbook "default is current"
+ files_mode "0744"
+ files_owner "jboss"
+ files_group "jboss"
+ mode "0755"
+ owner "jboss"
+ group "jboss"
+ overwrite true
+ recursive true
+ action :create
+end \ No newline at end of file
diff --git a/recipes/mso-po-adapter-config.rb b/recipes/mso-po-adapter-config.rb
new file mode 100644
index 0000000..5c7abe8
--- /dev/null
+++ b/recipes/mso-po-adapter-config.rb
@@ -0,0 +1,37 @@
+################
+#
+######
+include_recipe 'mso-config::createConfigDirectories'
+
+################
+#
+######
+['cloud_config.json','mso.vnf.properties','mso.network.properties','mso.tenant.properties'].each do |file|
+ template "#{node['mso_config_path']}#{file}" do
+ source "mso-po-adapter-config/#{file}"
+ owner "jboss"
+ group "jboss"
+ mode "0744"
+ variables(
+ :var => node["mso-po-adapter-config"]
+ )
+ end
+end
+
+################
+#
+######
+remote_directory "#{node['mso_config_path']}" do
+ source "mso-po-adapter-config"
+ #cookbook "default is current"
+ files_mode "0744"
+ files_owner "jboss"
+ files_group "jboss"
+ mode "0755"
+ owner "jboss"
+ group "jboss"
+ overwrite true
+ recursive true
+ action :create
+end
+
diff --git a/recipes/mso-requests-db-adapter-config.rb b/recipes/mso-requests-db-adapter-config.rb
new file mode 100644
index 0000000..b0a3481
--- /dev/null
+++ b/recipes/mso-requests-db-adapter-config.rb
@@ -0,0 +1,23 @@
+################
+#
+######
+include_recipe 'mso-config::createConfigDirectories'
+
+
+################
+#
+######
+remote_directory "#{node['mso_config_path']}" do
+ source "mso-requests-db-adapter-config"
+ #cookbook "default is current"
+ files_mode "0744"
+ files_owner "jboss"
+ files_group "jboss"
+ mode "0755"
+ owner "jboss"
+ group "jboss"
+ overwrite true
+ recursive true
+ action :create
+end
+
diff --git a/recipes/mso-sdnc-adapter-config.rb b/recipes/mso-sdnc-adapter-config.rb
new file mode 100644
index 0000000..74b2be4
--- /dev/null
+++ b/recipes/mso-sdnc-adapter-config.rb
@@ -0,0 +1,37 @@
+################
+#
+######
+include_recipe 'mso-config::createConfigDirectories'
+
+################
+#
+######
+['mso.sdnc.properties'].each do |file|
+ template "#{node['mso_config_path']}#{file}" do
+ source "mso-sdnc-adapter-config/#{file}"
+ owner "jboss"
+ group "jboss"
+ mode "0744"
+ variables(
+ :var => node["mso-sdnc-adapter-config"]
+ )
+ end
+end
+
+################
+#
+######
+remote_directory "#{node['mso_config_path']}" do
+ source "mso-sdnc-adapter-config"
+ #cookbook "default is current"
+ files_mode "0744"
+ files_owner "jboss"
+ files_group "jboss"
+ mode "0755"
+ owner "jboss"
+ group "jboss"
+ overwrite true
+ recursive true
+ action :create
+end
+
diff --git a/recipes/mso-topology-config.rb b/recipes/mso-topology-config.rb
new file mode 100644
index 0000000..214c985
--- /dev/null
+++ b/recipes/mso-topology-config.rb
@@ -0,0 +1,14 @@
+######################
+# Topology template file
+##########
+['topology.properties'].each do |file|
+ template "#{node['mso_config_path']}#{file}" do
+ source "mso-topology-config/#{file}"
+ owner "jboss"
+ group "jboss"
+ mode "0744"
+ variables(
+ :var => node["mso-config"]["topology"]
+ )
+ end
+end