From 8f95c220f50944044b04bfee15cd92c6cc9613f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Thu, 24 Jan 2019 19:23:09 +0100 Subject: [PATCH] Install Ruby in the backup cookbook Also switch to the 5.0 beta version, it works with modern Rubies --- site-cookbooks/backup/metadata.rb | 2 ++ site-cookbooks/backup/recipes/default.rb | 6 +++++- site-cookbooks/backup/templates/default/config.rb.erb | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/site-cookbooks/backup/metadata.rb b/site-cookbooks/backup/metadata.rb index 5cd3ae7..3e854e3 100644 --- a/site-cookbooks/backup/metadata.rb +++ b/site-cookbooks/backup/metadata.rb @@ -8,3 +8,5 @@ name "backup" depends 'logrotate' depends 'mysql' +depends 'postgresql' +depends 'build-essential' diff --git a/site-cookbooks/backup/recipes/default.rb b/site-cookbooks/backup/recipes/default.rb index 8d34348..4123e4d 100644 --- a/site-cookbooks/backup/recipes/default.rb +++ b/site-cookbooks/backup/recipes/default.rb @@ -23,8 +23,12 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +build_essential 'backup gem' + +package ["ruby", "ruby-dev"] + gem_package 'backup' do - version '4.4.0' + version '5.0.0.beta.2' end backup_data = Chef::EncryptedDataBagItem.load('credentials', 'backup') diff --git a/site-cookbooks/backup/templates/default/config.rb.erb b/site-cookbooks/backup/templates/default/config.rb.erb index dec61a8..ee07022 100644 --- a/site-cookbooks/backup/templates/default/config.rb.erb +++ b/site-cookbooks/backup/templates/default/config.rb.erb @@ -1,7 +1,7 @@ # encoding: utf-8 ## -# Backup v4.x Configuration +# Backup v5.x Configuration # # Documentation: http://backup.github.io/backup # Issue Tracker: https://github.com/backup/backup/issues @@ -56,8 +56,8 @@ end <%- if node["backup"]["postgresql"] -%> Database::PostgreSQL.defaults do |db| - db.username = "<%= node["backup"]["postgresql"]["username"] %>" - db.password = "<%= node["backup"]["postgresql"]["password"] %>" + db.username = "postgres" + db.password = "<%= node['postgresql']['password']['postgres'] %>" db.host = "<%= node["backup"]["postgresql"]["host"] %>" db.port = "<%= node["backup"]["postgresql"]["port"] %>" # db.socket = "/var/run/postgresql/.s.PGSQL.5432"