From e48b06b150be7dce0471d9d9673a00845bcbd8d8 Mon Sep 17 00:00:00 2001 From: Braulio Bhavamitra Date: Sat, 30 May 2015 22:20:01 -0300 Subject: [PATCH] Define models via attributes --- attributes/default.rb | 3 +++ recipes/default.rb | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/attributes/default.rb b/attributes/default.rb index b4f4e55..442ce78 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -34,3 +34,6 @@ default['backup']['upgrade?'] = false default['backup']['server'] = {} + +default['backup']['models'] = {} + diff --git a/recipes/default.rb b/recipes/default.rb index 3262581..c7d4b0a 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -45,6 +45,14 @@ end end +node['backup']['models'].each do |name, options| + backup_model name do + options.each do |attr, value| + send attr, value + end + end +end + template "Backup config file" do path ::File.join( node['backup']['config_path'], "config.rb") source 'config.rb.erb'