Set up an instance of Mastodon for Kosmos

Refs #19

Use new application cookbook, update our cookbooks
This commit is contained in:
Greg Karékinian
2017-04-06 21:20:51 +02:00
parent a3f5c5f646
commit de11c0d691
345 changed files with 22591 additions and 3473 deletions

View File

@@ -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')

View File

@@ -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