summaryrefslogtreecommitdiffstats
path: root/cookbooks/ajsc-aai-config/recipes/createConfigDirectories.rb
blob: eac5cd18ab037aefc273b8f6adcf51b362caebe7 (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
# 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