diff options
Diffstat (limited to 'cookbooks/ajsc-aai-config/recipes')
7 files changed, 269 insertions, 0 deletions
diff --git a/cookbooks/ajsc-aai-config/recipes/aai-config.rb b/cookbooks/ajsc-aai-config/recipes/aai-config.rb new file mode 100644 index 0000000..7cbae3a --- /dev/null +++ b/cookbooks/ajsc-aai-config/recipes/aai-config.rb @@ -0,0 +1,89 @@ +################ +# Update aaiconfig.properties +###### +include_recipe 'ajsc-aai-config::createConfigDirectories' + +['aaiconfig.properties'].each do |file| + template "#{node['aai-app-config']['PROJECT_HOME']}/bundleconfig/etc/appprops/#{file}" do + source "aai-app-config/#{file}" + owner "aaiadmin" + group "aaiadmin" + mode "0644" + variables( +:TOMCAT_SHUTDOWN_PORT_1 => node["aai-app-config"]["TOMCAT_SHUTDOWN_PORT_1"], +:TOMCAT_HTTP_SERVER_PORT_1 => node["aai-app-config"]["TOMCAT_HTTP_SERVER_PORT_1"], +:TOMCAT_HTTPS_SERVER_PORT_1 => node["aai-app-config"]["TOMCAT_HTTPS_SERVER_PORT_1"], +:TOMCAT_AJP13_CONNECTOR_PORT_1 => node["aai-app-config"]["TOMCAT_AJP13_CONNECTOR_PORT_1"], +:AAI_SERVER_URL_BASE => node["aai-app-config"]["AAI_SERVER_URL_BASE"], +:AAI_SERVER_URL => node["aai-app-config"]["AAI_SERVER_URL"], +:AAI_OLDSERVER_URL => node["aai-app-config"]["AAI_OLDSERVER_URL"], +:AAI_GLOBAL_CALLBACK_URL => node["aai-app-config"]["AAI_GLOBAL_CALLBACK_URL"], +:AAI_TRUSTSTORE_FILENAME => node["aai-app-config"]["AAI_TRUSTSTORE_FILENAME"], +:AAI_TRUSTSTORE_PASSWD_X => node["aai-app-config"]["AAI_TRUSTSTORE_PASSWD_X"], +:AAI_KEYSTORE_FILENAME => node["aai-app-config"]["AAI_KEYSTORE_FILENAME"], +:AAI_KEYSTORE_PASSWD_X => node["aai-app-config"]["AAI_KEYSTORE_PASSWD_X"], +:STORAGE_HOSTNAME => node["aai-app-config"]["STORAGE_HOSTNAME"], +:STORAGE_BACKEND => node["aai-app-config"]["STORAGE_BACKEND"], +:STORAGE_HBASE_TABLE => node["aai-app-config"]["STORAGE_HBASE_TABLE"], +:STORAGE_HBASE_ZOOKEEPER_ZNODE_PARENT => node["aai-app-config"]["STORAGE_HBASE_ZOOKEEPER_ZNODE_PARENT"], +:HBASE_COLUMN_TTL_DAYS => node["aai-app-config"]["HBASE_COLUMN_TTL_DAYS"], +:TXN_HBASE_TABLE_NAME => node["aai-app-config"]["TXN_HBASE_TABLE_NAME"], +:TXN_ZOOKEEPER_QUORUM => node["aai-app-config"]["TXN_ZOOKEEPER_QUORUM"], +:TXN_ZOOKEEPER_PROPERTY_CLIENTPORT => node["aai-app-config"]["TXN_ZOOKEEPER_PROPERTY_CLIENTPORT"], +:TXN_HBASE_ZOOKEEPER_ZNODE_PARENT => node["aai-app-config"]["TXN_HBASE_ZOOKEEPER_ZNODE_PARENT"], +:NOTIFICATION_HBASE_TABLE_NAME => node["aai-app-config"]["NOTIFICATION_HBASE_TABLE_NAME"], +:APPLICATION_SERVERS => node["aai-app-config"]["APPLICATION_SERVERS"], +:AAI_NOTIFICATION_CURRENT_VERSION => node["aai-app-config"]["AAI_NOTIFICATION_CURRENT_VERSION"], +:AAI_NOTIFICATION_EVENT_DEFAULT_EVENT_STATUS => node["aai-app-config"]["AAI_NOTIFICATION_EVENT_DEFAULT_EVENT_STATUS"], +:AAI_NOTIFICATION_EVENT_DEFAULT_EVENT_TYPE => node["aai-app-config"]["AAI_NOTIFICATION_EVENT_DEFAULT_EVENT_TYPE"], +:AAI_NOTIFICATION_EVENT_DEFAULT_DOMAIN => node["aai-app-config"]["AAI_NOTIFICATION_EVENT_DEFAULT_DOMAIN"], +:AAI_NOTIFICATION_EVENT_DEFAULT_SOURCE_NAME => node["aai-app-config"]["AAI_NOTIFICATION_EVENT_DEFAULT_SOURCE_NAME"], +:AAI_NOTIFICATION_EVENT_DEFAULT_SEQUENCE_NUMBER => node["aai-app-config"]["AAI_NOTIFICATION_EVENT_DEFAULT_SEQUENCE_NUMBER"], +:AAI_NOTIFICATION_EVENT_DEFAULT_SEVERITY => node["aai-app-config"]["AAI_NOTIFICATION_EVENT_DEFAULT_SEVERITY"], +:AAI_NOTIFICATION_EVENT_DEFAULT_VERSION => node["aai-app-config"]["AAI_NOTIFICATION_EVENT_DEFAULT_VERSION"], +:RESOURCE_VERSION_ENABLE_FLAG => node["aai-app-config"]["RESOURCE_VERSION_ENABLE_FLAG"], +:AAI_DEFAULT_API_VERSION => node["aai-app-config"]["AAI_DEFAULT_API_VERSION"], +:AAI_DMAPP_WORKLOAD_ENABLE_EVENT_PROCESSING => node["aai-app-config"]["AAI_DMAPP_WORKLOAD_ENABLE_EVENT_PROCESSING"] + ) + end +end + +#remote_directory "/opt/mso/etc/ecomp/mso/config/" do +# source "mso-asdc-controller-config" +# #cookbook "default is current" +# files_mode "0700" +# files_owner "jboss" +# files_group "jboss" +# mode "0755" +# owner "jboss" +# group "jboss" +# overwrite true +# recursive true +# action :create +#end + + +################ +# Alternative example1 +# This updates all the timestamps +# Seting preserve never changes the timestamp when the file is changed +###### +# ruby_block "copy_recurse" do +# block do +# FileUtils.cp_r("#{Chef::Config[:file_cache_path]}/cookbooks/mso-config/files/default/mso-api-handler-config/.",\ +# "/opt/mso/etc/ecomp/mso/config/", :preserve => true) +# end +# action :run +# end + +################ +# Alternative example2 +###### +# Dir.glob("#{Chef::Config[:file_cache_path]}/cookbooks/mso-config/files/default/mso-api-handler-config/*").sort.each do |entry| +# cookbook_file "/opt/mso/etc/ecomp/mso/config/#{entry}" do +# source entry +# owner "root" +# group "root" +# mode 0755 +# end +# end diff --git a/cookbooks/ajsc-aai-config/recipes/aai-logback.rb b/cookbooks/ajsc-aai-config/recipes/aai-logback.rb new file mode 100644 index 0000000..505c44a --- /dev/null +++ b/cookbooks/ajsc-aai-config/recipes/aai-logback.rb @@ -0,0 +1,15 @@ +################ +# Update logback.xml +###### + +['logback.xml'].each do |file| + template "#{node['aai-app-config']['PROJECT_HOME']}/bundleconfig/etc/#{file}" do + source "aai-app-config/logback.erb" + owner "aaiadmin" + group "aaiadmin" + mode "0777" + variables( +:ORG_OPENECOMP_AAI_LEVEL => node["aai-app-config"]["ORG_OPENECOMP_AAI_LEVEL"] + ) + end +end diff --git a/cookbooks/ajsc-aai-config/recipes/aai-preferredRoute.rb b/cookbooks/ajsc-aai-config/recipes/aai-preferredRoute.rb new file mode 100644 index 0000000..c9f4887 --- /dev/null +++ b/cookbooks/ajsc-aai-config/recipes/aai-preferredRoute.rb @@ -0,0 +1,11 @@ +['preferredRoute.txt'].each do |file| + template "#{node['aai-app-config']['PROJECT_HOME']}/bundleconfig/etc/appprops/#{file}" do + source "aai-app-config/preferredRoute.txt" + owner "aaiadmin" + group "aaiadmin" + mode "0644" + variables( +:AAI_WORKLOAD_PREFERRED_ROUTE_KEY => node["aai-app-config"]["AAI_WORKLOAD_PREFERRED_ROUTE_KEY"] + ) + end +end
\ No newline at end of file diff --git a/cookbooks/ajsc-aai-config/recipes/aaiWorkloadConsumer.rb b/cookbooks/ajsc-aai-config/recipes/aaiWorkloadConsumer.rb new file mode 100644 index 0000000..676e5ce --- /dev/null +++ b/cookbooks/ajsc-aai-config/recipes/aaiWorkloadConsumer.rb @@ -0,0 +1,32 @@ +['aaiWorkloadConsumer.properties'].each do |file| + template "#{node['aai-app-config']['PROJECT_HOME']}/bundleconfig/etc/appprops/#{file}" do + source "aai-app-config/aaiWorkloadConsumer.properties" + owner "aaiadmin" + group "aaiadmin" + mode "0644" + variables( +:AAI_WORKLOAD_SERVICE_NAME => node["aai-app-config"]["AAI_WORKLOAD_SERVICE_NAME"], +:AAI_WORKLOAD_ENVIRONMENT => node["aai-app-config"]["AAI_WORKLOAD_ENVIRONMENT"], +:AAI_WORKLOAD_USERNAME => node["aai-app-config"]["AAI_WORKLOAD_USERNAME"], +:AAI_WORKLOAD_PASSWORD => node["aai-app-config"]["AAI_WORKLOAD_PASSWORD"], +:AAI_WORKLOAD_HOST => node["aai-app-config"]["AAI_WORKLOAD_HOST"], +:AAI_WORKLOAD_AFT_DME2_EXCHANGE_REQUEST_HANDLERS => node["aai-app-config"]["AAI_WORKLOAD_AFT_DME2_EXCHANGE_REQUEST_HANDLERS"], +:AAI_WORKLOAD_AFT_DME2_EXCHANGE_REPLY_HANDLERS => node["aai-app-config"]["AAI_WORKLOAD_AFT_DME2_EXCHANGE_REPLY_HANDLERS"], +:AAI_WORKLOAD_AFT_DME2_REQ_TRACE_ON => node["aai-app-config"]["AAI_WORKLOAD_AFT_DME2_REQ_TRACE_ON"], +:AAI_WORKLOAD_AFT_ENVIRONMENT => node["aai-app-config"]["AAI_WORKLOAD_AFT_ENVIRONMENT"], +:AAI_WORKLOAD_AFT_DME2_EP_CONN_TIMEOUT => node["aai-app-config"]["AAI_WORKLOAD_AFT_DME2_EP_CONN_TIMEOUT"], +:AAI_WORKLOAD_AFT_DME2_ROUNDTRIP_TIMEOUT_MS => node["aai-app-config"]["AAI_WORKLOAD_AFT_DME2_ROUNDTRIP_TIMEOUT_MS"], +:AAI_WORKLOAD_AFT_DME2_EP_READ_TIMEOUT_MS => node["aai-app-config"]["AAI_WORKLOAD_AFT_DME2_EP_READ_TIMEOUT_MS"], +:AAI_WORKLOAD_SESSION_STICKINESS_REQUIRED => node["aai-app-config"]["AAI_WORKLOAD_SESSION_STICKINESS_REQUIRED"], +:AAI_WORKLOAD_DME2_PREFERRED_ROUTER_FILE_PATH => node["aai-app-config"]["AAI_WORKLOAD_DME2_PREFERRED_ROUTER_FILE_PATH"], +:AAI_WORKLOAD_PARTNER => node["aai-app-config"]["AAI_WORKLOAD_PARTNER"], +:AAI_WORKLOAD_ROUTE_OFFER => node["aai-app-config"]["AAI_WORKLOAD_ROUTE_OFFER"], +:AAI_WORKLOAD_PROTOCOL => node["aai-app-config"]["AAI_WORKLOAD_PROTOCOL"], +:AAI_WORKLOAD_FILTER => node["aai-app-config"]["AAI_WORKLOAD_FILTER"], +:AAI_WORKLOAD_TOPIC => node["aai-app-config"]["AAI_WORKLOAD_TOPIC"], +:AAI_WORKLOAD_ID => node["aai-app-config"]["AAI_WORKLOAD_ID"], +:AAI_WORKLOAD_TIMEOUT => node["aai-app-config"]["AAI_WORKLOAD_TIMEOUT"], +:AAI_WORKLOAD_LIMIT => node["aai-app-config"]["AAI_WORKLOAD_LIMIT"] + ) + end +end
\ No newline at end of file diff --git a/cookbooks/ajsc-aai-config/recipes/aaiWorkloadPublisher.rb b/cookbooks/ajsc-aai-config/recipes/aaiWorkloadPublisher.rb new file mode 100644 index 0000000..815f29c --- /dev/null +++ b/cookbooks/ajsc-aai-config/recipes/aaiWorkloadPublisher.rb @@ -0,0 +1,31 @@ +['aaiWorkloadPublisher.properties'].each do |file| + template "#{node['aai-app-config']['PROJECT_HOME']}/bundleconfig/etc/appprops/#{file}" do + source "aai-app-config/aaiWorkloadPublisher.properties" + owner "aaiadmin" + group "aaiadmin" + mode "0644" + variables( +:AAI_WORKLOAD_SERVICE_NAME => node["aai-app-config"]["AAI_WORKLOAD_SERVICE_NAME"], +:AAI_WORKLOAD_ENVIRONMENT => node["aai-app-config"]["AAI_WORKLOAD_ENVIRONMENT"], +:AAI_WORKLOAD_USERNAME => node["aai-app-config"]["AAI_WORKLOAD_USERNAME"], +:AAI_WORKLOAD_PASSWORD => node["aai-app-config"]["AAI_WORKLOAD_PASSWORD"], +:AAI_WORKLOAD_HOST => node["aai-app-config"]["AAI_WORKLOAD_HOST"], +:AAI_WORKLOAD_AFT_DME2_EXCHANGE_REQUEST_HANDLERS => node["aai-app-config"]["AAI_WORKLOAD_AFT_DME2_EXCHANGE_REQUEST_HANDLERS"], +:AAI_WORKLOAD_AFT_DME2_EXCHANGE_REPLY_HANDLERS => node["aai-app-config"]["AAI_WORKLOAD_AFT_DME2_EXCHANGE_REPLY_HANDLERS"], +:AAI_WORKLOAD_AFT_DME2_REQ_TRACE_ON => node["aai-app-config"]["AAI_WORKLOAD_AFT_DME2_REQ_TRACE_ON"], +:AAI_WORKLOAD_AFT_ENVIRONMENT => node["aai-app-config"]["AAI_WORKLOAD_AFT_ENVIRONMENT"], +:AAI_WORKLOAD_AFT_DME2_EP_CONN_TIMEOUT => node["aai-app-config"]["AAI_WORKLOAD_AFT_DME2_EP_CONN_TIMEOUT"], +:AAI_WORKLOAD_AFT_DME2_ROUNDTRIP_TIMEOUT_MS => node["aai-app-config"]["AAI_WORKLOAD_AFT_DME2_ROUNDTRIP_TIMEOUT_MS"], +:AAI_WORKLOAD_AFT_DME2_EP_READ_TIMEOUT_MS => node["aai-app-config"]["AAI_WORKLOAD_AFT_DME2_EP_READ_TIMEOUT_MS"], +:AAI_WORKLOAD_SESSION_STICKINESS_REQUIRED => node["aai-app-config"]["AAI_WORKLOAD_SESSION_STICKINESS_REQUIRED"], +:AAI_WORKLOAD_DME2_PREFERRED_ROUTER_FILE_PATH => node["aai-app-config"]["AAI_WORKLOAD_DME2_PREFERRED_ROUTER_FILE_PATH"], +:AAI_WORKLOAD_PARTNER => node["aai-app-config"]["AAI_WORKLOAD_PARTNER"], +:AAI_WORKLOAD_ROUTE_OFFER => node["aai-app-config"]["AAI_WORKLOAD_ROUTE_OFFER"], +:AAI_WORKLOAD_PROTOCOL => node["aai-app-config"]["AAI_WORKLOAD_PROTOCOL"], +:AAI_WORKLOAD_TOPIC => node["aai-app-config"]["AAI_WORKLOAD_TOPIC"], +:AAI_WORKLOAD_MAX_BATCH_SIZE => node["aai-app-config"]["AAI_WORKLOAD_MAX_BATCH_SIZE"], +:AAI_WORKLOAD_MAX_AGE_MS => node["aai-app-config"]["AAI_WORKLOAD_MAX_AGE_MS"], +:AAI_WORKLOAD_MESSAGE_SENT_THREAD_OCCURANCE => node["aai-app-config"]["AAI_WORKLOAD_MESSAGE_SENT_THREAD_OCCURANCE"] + ) + end +end
\ No newline at end of file diff --git a/cookbooks/ajsc-aai-config/recipes/aaiWorkloadStatusPublisher.rb b/cookbooks/ajsc-aai-config/recipes/aaiWorkloadStatusPublisher.rb new file mode 100644 index 0000000..032737e --- /dev/null +++ b/cookbooks/ajsc-aai-config/recipes/aaiWorkloadStatusPublisher.rb @@ -0,0 +1,31 @@ +['aaiWorkloadStatusPublisher.properties'].each do |file| + template "#{node['aai-app-config']['PROJECT_HOME']}/bundleconfig/etc/appprops/#{file}" do + source "aai-app-config/aaiWorkloadStatusPublisher.properties" + owner "aaiadmin" + group "aaiadmin" + mode "0644" + variables( +:AAI_WORKLOAD_SERVICE_NAME => node["aai-app-config"]["AAI_WORKLOAD_SERVICE_NAME"], +:AAI_WORKLOAD_ENVIRONMENT => node["aai-app-config"]["AAI_WORKLOAD_ENVIRONMENT"], +:AAI_WORKLOAD_USERNAME => node["aai-app-config"]["AAI_WORKLOAD_USERNAME"], +:AAI_WORKLOAD_PASSWORD => node["aai-app-config"]["AAI_WORKLOAD_PASSWORD"], +:AAI_WORKLOAD_HOST => node["aai-app-config"]["AAI_WORKLOAD_HOST"], +:AAI_WORKLOAD_AFT_DME2_EXCHANGE_REQUEST_HANDLERS => node["aai-app-config"]["AAI_WORKLOAD_AFT_DME2_EXCHANGE_REQUEST_HANDLERS"], +:AAI_WORKLOAD_AFT_DME2_EXCHANGE_REPLY_HANDLERS => node["aai-app-config"]["AAI_WORKLOAD_AFT_DME2_EXCHANGE_REPLY_HANDLERS"], +:AAI_WORKLOAD_AFT_DME2_REQ_TRACE_ON => node["aai-app-config"]["AAI_WORKLOAD_AFT_DME2_REQ_TRACE_ON"], +:AAI_WORKLOAD_AFT_ENVIRONMENT => node["aai-app-config"]["AAI_WORKLOAD_AFT_ENVIRONMENT"], +:AAI_WORKLOAD_AFT_DME2_EP_CONN_TIMEOUT => node["aai-app-config"]["AAI_WORKLOAD_AFT_DME2_EP_CONN_TIMEOUT"], +:AAI_WORKLOAD_AFT_DME2_ROUNDTRIP_TIMEOUT_MS => node["aai-app-config"]["AAI_WORKLOAD_AFT_DME2_ROUNDTRIP_TIMEOUT_MS"], +:AAI_WORKLOAD_AFT_DME2_EP_READ_TIMEOUT_MS => node["aai-app-config"]["AAI_WORKLOAD_AFT_DME2_EP_READ_TIMEOUT_MS"], +:AAI_WORKLOAD_SESSION_STICKINESS_REQUIRED => node["aai-app-config"]["AAI_WORKLOAD_SESSION_STICKINESS_REQUIRED"], +:AAI_WORKLOAD_DME2_PREFERRED_ROUTER_FILE_PATH => node["aai-app-config"]["AAI_WORKLOAD_DME2_PREFERRED_ROUTER_FILE_PATH"], +:AAI_WORKLOAD_PARTNER => node["aai-app-config"]["AAI_WORKLOAD_PARTNER"], +:AAI_WORKLOAD_ROUTE_OFFER => node["aai-app-config"]["AAI_WORKLOAD_ROUTE_OFFER"], +:AAI_WORKLOAD_PROTOCOL => node["aai-app-config"]["AAI_WORKLOAD_PROTOCOL"], +:AAI_WORKLOAD_MAX_BATCH_SIZE => node["aai-app-config"]["AAI_WORKLOAD_MAX_BATCH_SIZE"], +:AAI_WORKLOAD_MAX_AGE_MS => node["aai-app-config"]["AAI_WORKLOAD_MAX_AGE_MS"], +:AAI_WORKLOAD_MESSAGE_SENT_THREAD_OCCURANCE => node["aai-app-config"]["AAI_WORKLOAD_MESSAGE_SENT_THREAD_OCCURANCE"], +:AAI_WORKLOAD_STATUS_PUBLISHER_TOPIC => node["aai-app-config"]["AAI_WORKLOAD_STATUS_PUBLISHER_TOPIC"] + ) + end +end
\ No newline at end of file diff --git a/cookbooks/ajsc-aai-config/recipes/createConfigDirectories.rb b/cookbooks/ajsc-aai-config/recipes/createConfigDirectories.rb new file mode 100644 index 0000000..eac5cd1 --- /dev/null +++ b/cookbooks/ajsc-aai-config/recipes/createConfigDirectories.rb @@ -0,0 +1,60 @@ +# Create or update the needed directories/links. +# If the directory already exists, it is updated to match +# +# LOGROOT should already be created by the SWM installation script +# It needs to run as root + +execute "mv logs logs.bak" do + only_if { ::File.directory?("#{node['aai-app-config']['PROJECT_HOME']}/logs") } + user 'aaiadmin' + group 'aaiadmin' + cwd "#{node['aai-app-config']['PROJECT_HOME']}" +end + +[ + "#{node['aai-app-config']['LOGROOT']}/AAI", + "#{node['aai-app-config']['LOGROOT']}/AAI/data", + "#{node['aai-app-config']['LOGROOT']}/AAI/misc", + "#{node['aai-app-config']['LOGROOT']}/AAI/ajsc-jetty" ].each do |path| + directory path do + owner 'aaiadmin' + group 'aaiadmin' + mode '0755' + recursive=true + action :create + end +end + +[ "#{node['aai-app-config']['PROJECT_HOME']}/bundleconfig/etc/auth" ].each do |path| + directory path do + owner 'aaiadmin' + group 'aaiadmin' + mode '0777' + recursive=true + action :create + end +end +#Application logs +link "#{node['aai-app-config']['PROJECT_HOME']}/logs" do + to "#{node['aai-app-config']['LOGROOT']}/AAI" + owner 'aaiadmin' + group 'aaiadmin' + mode '0755' +end + +#Make a link from /opt/app/aai/scripts to /opt/app/aai/bin +link "#{node['aai-app-config']['PROJECT_HOME']}/scripts" do + to "#{node['aai-app-config']['PROJECT_HOME']}/bin" + owner 'aaiadmin' + group 'aaiadmin' + mode '0755' +end + +#Process logs?? +#ln -s ${LOGROOT}/aai/servers/${server}/logs ${TRUE_PROJECT_HOME}/servers/${server}/logs +#link "#{node['aai-app-config']['PROJECT_HOME']}/servers/aai/logs" do +# to "#{node['aai-app-config']['LOGROOT']}/aai/servers/aai/logs" +# owner 'aaiadmin' +# group 'aaiadmin' +# mode '0755' +#end |