Set up an instance of Mastodon for Kosmos
Refs #19 Use new application cookbook, update our cookbooks
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
gem_package 'backup' do
|
||||
version '4.2.3'
|
||||
version '4.4.0'
|
||||
end
|
||||
|
||||
backup_data = Chef::EncryptedDataBagItem.load('credentials', 'backup')
|
||||
|
||||
@@ -45,6 +45,15 @@ Database::MySQL.defaults do |db|
|
||||
end
|
||||
<%- end -%>
|
||||
|
||||
<%- if node["backup"]["postgresql"] -%>
|
||||
Database::MySQL.defaults do |db|
|
||||
db.host = "<%= node["backup"]["postgresql"]["host"] %>"
|
||||
db.username = "<%= node["backup"]["postgresql"]["username"] %>"
|
||||
db.password = "<%= node["backup"]["postgresql"]["password"] %>"
|
||||
db.additional_options = ['--quick', '--single-transaction']
|
||||
end
|
||||
<%- end -%>
|
||||
|
||||
Database::Redis.defaults do |db|
|
||||
db.host = "<%= node["backup"]["redis"]["host"] %>"
|
||||
db.port = 6379
|
||||
@@ -53,6 +62,20 @@ Database::Redis.defaults do |db|
|
||||
<%# db.socket = "/tmp/redis.sock"%>
|
||||
end
|
||||
|
||||
<%- if node["backup"]["postgresql"] -%>
|
||||
database PostgreSQL do |db|
|
||||
db.username = ""
|
||||
db.password = "<%= node['postgresql']['password']['postgres'] %>"
|
||||
db.host = "localhost"
|
||||
db.port = 5432
|
||||
db.socket = "/tmp/pg.sock"
|
||||
# When dumping all databases, `skip_tables` and `only_tables` are ignored.
|
||||
db.skip_tables = ['skip', 'these', 'tables']
|
||||
db.only_tables = ['only', 'these' 'tables']
|
||||
db.additional_options = []
|
||||
end
|
||||
<% end -%>
|
||||
|
||||
preconfigure 'KosmosBackup' do
|
||||
split_into_chunks_of 250 # megabytes
|
||||
store_with S3
|
||||
|
||||
Reference in New Issue
Block a user