diff --git a/attributes/default.rb b/attributes/default.rb index 124cae2..0d6b496 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -3,7 +3,12 @@ default['stash']['version'] = '4.1.0' default['stash']['product'] = Chef::Version.new(node['stash']['version']) >= Chef::Version.new('4.0.0') ? 'bitbucket' : 'stash' -default['stash']['home_path'] = "/var/atlassian/application-data/#{node['stash']['product']}" +if Dir.exists?('/var/atlassian/application-data/stash') + default['stash']['home_path'] = '/var/atlassian/application-data/stash' +else + default['stash']['home_path'] = "/var/atlassian/application-data/#{node['stash']['product']}" +end + default['stash']['install_path'] = '/opt/atlassian' default['stash']['install_type'] = 'standalone' default['stash']['service_type'] = 'init' diff --git a/recipes/configuration.rb b/recipes/configuration.rb index 1fe92e1..8777c41 100644 --- a/recipes/configuration.rb +++ b/recipes/configuration.rb @@ -22,6 +22,12 @@ action :create recursive true end + + bash 'update home path permission' do + code <<-EOH + chown -R #{node['stash']['user']}:#{node['stash']['user']} #{node['stash']['home_path']} + EOH + end else config_path = '/stash-config.properties' end