Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made some fix. #1

Merged
merged 2 commits into from
May 20, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
# Chef::Log.info "Enable wal-e for postgres"
wal_e = node["wal_e"]
wal_e_env = "/etc/wal-e.d/env"
postgres_install_path = node['postgresql']['dir']
if 'debian' == node['platform_family']
postgres_install_path = node['postgresql']['config']['data_directory']
else
postgres_install_path = node['postgresql']['dir']
end
backup_push_command = "/usr/bin/envdir #{wal_e_env} /usr/local/bin/wal-e backup-push #{postgres_install_path}"


# Chef::Log.info "update postgresql configuration for wal_archiving"
node['postgresql']['config']["wal_level"] = "archive"
node['postgresql']['config']["archive_mode"] = "on"
Expand Down Expand Up @@ -78,11 +81,3 @@
user "postgres"
command backup_push_command
end

# Chef::Log.info "run the initial snap shot during the provision"
execute "wal-e initial backup-push" do
user "postgres"
group "postgres"
command backup_push_command
only_if { ::Dir.glob("#{postgres_install_path}/pg_xlog/*.backup").empty? }
end