summaryrefslogtreecommitdiffstats
path: root/cookbooks/aai-traversal/aai-traversal-config/recipes/aai-traversal-config.rb
blob: aae12d0d4f5844c3dd11341f7be0045a2de410a7 (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
67
68
69
70
71
72
73
74
75
76
77
################
# Update aaiGraphQueryConfig.properties 
################
include_recipe 'aai-traversal-config::createConfigDirectories'
  
['aaiconfig.properties'].each do |file|
  template "#{node['aai-traversal-config']['PROJECT_HOME']}/bundleconfig/etc/appprops/#{file}" do
    source "aai-traversal-app-config/aaiconfig.properties"
    owner "aaiadmin"
    group "aaiadmin"
    mode "0644"
    variables(
:AAI_SERVER_URL_BASE => node["aai-traversal-config"]["AAI_SERVER_URL_BASE"],
:AAI_SERVER_URL => node["aai-traversal-config"]["AAI_SERVER_URL"],
:AAI_GLOBAL_CALLBACK_URL => node["aai-traversal-config"]["AAI_GLOBAL_CALLBACK_URL"],
:AAI_TRUSTSTORE_FILENAME => node["aai-traversal-config"]["AAI_TRUSTSTORE_FILENAME"],
:AAI_TRUSTSTORE_PASSWD_X => node["aai-traversal-config"]["AAI_TRUSTSTORE_PASSWD_X"],
:AAI_KEYSTORE_FILENAME => node["aai-traversal-config"]["AAI_KEYSTORE_FILENAME"],
:AAI_KEYSTORE_PASSWD_X => node["aai-traversal-config"]["AAI_KEYSTORE_PASSWD_X"],
:APPLICATION_SERVERS => node["aai-traversal-config"]["APPLICATION_SERVERS"], 
:TXN_HBASE_TABLE_NAME => node["aai-traversal-config"]["TXN_HBASE_TABLE_NAME"],
:TXN_ZOOKEEPER_QUORUM => node["aai-traversal-config"]["TXN_ZOOKEEPER_QUORUM"],
:TXN_ZOOKEEPER_PROPERTY_CLIENTPORT => node["aai-traversal-config"]["TXN_ZOOKEEPER_PROPERTY_CLIENTPORT"],
:TXN_HBASE_ZOOKEEPER_ZNODE_PARENT => node["aai-traversal-config"]["TXN_HBASE_ZOOKEEPER_ZNODE_PARENT"],
:RESOURCE_VERSION_ENABLE_FLAG => node["aai-traversal-config"]["RESOURCE_VERSION_ENABLE_FLAG"],
    :AAI_NOTIFICATION_CURRENT_VERSION => node["aai-traversal-config"]["AAI_NOTIFICATION_CURRENT_VERSION"],
    :AAI_NOTIFICATION_EVENT_DEFAULT_EVENT_STATUS => node["aai-traversal-config"]["AAI_NOTIFICATION_EVENT_DEFAULT_EVENT_STATUS"],
    :AAI_NOTIFICATION_EVENT_DEFAULT_EVENT_TYPE => node["aai-traversal-config"]["AAI_NOTIFICATION_EVENT_DEFAULT_EVENT_TYPE"],
    :AAI_NOTIFICATION_EVENT_DEFAULT_DOMAIN => node["aai-traversal-config"]["AAI_NOTIFICATION_EVENT_DEFAULT_DOMAIN"],
    :AAI_NOTIFICATION_EVENT_DEFAULT_SOURCE_NAME => node["aai-traversal-config"]["AAI_NOTIFICATION_EVENT_DEFAULT_SOURCE_NAME"],
    :AAI_NOTIFICATION_EVENT_DEFAULT_SEQUENCE_NUMBER => node["aai-traversal-config"]["AAI_NOTIFICATION_EVENT_DEFAULT_SEQUENCE_NUMBER"],
    :AAI_NOTIFICATION_EVENT_DEFAULT_SEVERITY => node["aai-traversal-config"]["AAI_NOTIFICATION_EVENT_DEFAULT_SEVERITY"],
    :AAI_NOTIFICATION_EVENT_DEFAULT_VERSION => node["aai-traversal-config"]["AAI_NOTIFICATION_EVENT_DEFAULT_VERSION"],
:AAI_DEFAULT_API_VERSION => node["aai-traversal-config"]["AAI_DEFAULT_API_VERSION"]
      )
  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