Skip to content

Commit

Permalink
Merge pull request #203 from opscode/ma/fix_bookshelf_setup
Browse files Browse the repository at this point in the history
Fix bookshelf directory creation problems in HA configurations (OC-10652)
  • Loading branch information
schisamo committed Nov 27, 2013
2 parents 1e2f598 + 5813da2 commit 6a5d77c
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions files/private-chef-cookbooks/private-chef/recipes/bookshelf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,38 +19,35 @@
mode "0755"
end

directory data_path do
action :create
recursive true
owner owner
group owner
end

execute "cookbook migration" do
command cookbook_migration
user owner
not_if { File.exist?("#{data_path}/_%_BOOKSHELF_DISK_FORMAT") }
end

#
# We need to create all of these directories up front
# Note that data_path will not be a subdir of bookshelf_dir in HA configurations
#
bookshelf_dir = node['private_chef']['bookshelf']['dir']
bookshelf_etc_dir = File.join(bookshelf_dir, "etc")
bookshelf_log_dir = node['private_chef']['bookshelf']['log_directory']
bookshelf_sasl_log_dir = File.join(bookshelf_log_dir, "sasl")
bookshelf_data_dir = node['private_chef']['bookshelf']['data_dir']
[
bookshelf_dir,
bookshelf_etc_dir,
bookshelf_log_dir,
bookshelf_sasl_log_dir,
bookshelf_data_dir,
data_path
].each do |dir_name|
directory dir_name do
owner node['private_chef']['user']['username']
owner owner
group owner
mode '0700'
recursive true
end
end

execute "cookbook migration" do
command cookbook_migration
user owner
not_if { File.exist?("#{data_path}/_%_BOOKSHELF_DISK_FORMAT") }
end

link "/opt/opscode/embedded/service/bookshelf/log" do
to bookshelf_log_dir
end
Expand Down

0 comments on commit 6a5d77c

Please sign in to comment.