Fix missing Mastodon/PosgreSQL backups

The backup cookbook was incomplete, and also there was no database
configured to be backed up.
This commit is contained in:
2018-09-08 12:54:51 +08:00
parent 214e69427e
commit 4bccf4dd88
4 changed files with 22 additions and 12 deletions

View File

@@ -180,10 +180,18 @@ application mastodon_path do
end
end
#
# Backup
#
unless node.chef_environment == "development"
# Backup the database to S3
node.override["backup"]["postgresql"]["host"] = "localhost"
node.override["backup"]["postgresql"]["username"] = "postgres"
node.override["backup"]["postgresql"]["password"] = node['postgresql']['password']['postgres']
unless node["backup"]["postgresql"]["databases"].include? 'mastodon'
node.override["backup"]["postgresql"]["databases"] =
node["backup"]["postgresql"]["databases"].to_a << "mastodon"
end
include_recipe "backup"
end