Skip to content

Commit

Permalink
Merge pull request #1 from lyrixx/fix
Browse files Browse the repository at this point in the history
Made some fix.
  • Loading branch information
house9 committed May 20, 2013
2 parents 14ce242 + 3f8be6c commit b990328
Showing 1 changed file with 5 additions and 10 deletions.
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

0 comments on commit b990328

Please sign in to comment.