From 2079b16056443fc1b05bdb06be2bfd8a85265c8c Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Thu, 3 Sep 2015 11:22:19 -0700 Subject: [PATCH 01/40] changing testing dynamics to account for race condition in chefspec, updating kitchen platforms/suites/chef-spec --- .kitchen.yml | 17 +++- .../serverspec/.rspec | 0 .../serverspec/bareos_spec.rb | 20 +++-- .../serverspec/spec/spec_helper.rb | 0 .../serverspec/spec_helper.rb | 0 test/integration/aio-server/serverspec/.rspec | 2 + .../aio-server/serverspec/bareos_spec.rb | 30 +++++++ .../aio-server/serverspec/spec/spec_helper.rb | 89 +++++++++++++++++++ .../aio-server/serverspec/spec_helper.rb | 16 ++++ 9 files changed, 162 insertions(+), 12 deletions(-) rename test/integration/{server => aio-server-pools}/serverspec/.rspec (100%) rename test/integration/{server => aio-server-pools}/serverspec/bareos_spec.rb (87%) rename test/integration/{server => aio-server-pools}/serverspec/spec/spec_helper.rb (100%) rename test/integration/{server => aio-server-pools}/serverspec/spec_helper.rb (100%) create mode 100644 test/integration/aio-server/serverspec/.rspec create mode 100644 test/integration/aio-server/serverspec/bareos_spec.rb create mode 100644 test/integration/aio-server/serverspec/spec/spec_helper.rb create mode 100644 test/integration/aio-server/serverspec/spec_helper.rb diff --git a/.kitchen.yml b/.kitchen.yml index 628b7f9..a4ae4f7 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -4,21 +4,32 @@ driver: provisioner: name: chef_zero - require_chef_omnibus: true + require_chef_omnibus: latest platforms: - name: debian-7.8 + - name: ubuntu-12.04 + run_list: + - recipe[apt] - name: ubuntu-14.04 run_list: - recipe[apt] - - name: centos-6.6 + - name: centos-6.7 data_bags_path: test/integration/data_bags/ roles_path: test/integration/roles/ environments_path: test/integration/environments suites: - - name: server + - name: aio-server + run_list: + - role[bareos_server] + attributes: + + - name: aio-server-pools run_list: - role[bareos_server] attributes: + bareos: + host_pools: true + custom_host_pools: true diff --git a/test/integration/server/serverspec/.rspec b/test/integration/aio-server-pools/serverspec/.rspec similarity index 100% rename from test/integration/server/serverspec/.rspec rename to test/integration/aio-server-pools/serverspec/.rspec diff --git a/test/integration/server/serverspec/bareos_spec.rb b/test/integration/aio-server-pools/serverspec/bareos_spec.rb similarity index 87% rename from test/integration/server/serverspec/bareos_spec.rb rename to test/integration/aio-server-pools/serverspec/bareos_spec.rb index bc63088..b6b14ce 100644 --- a/test/integration/server/serverspec/bareos_spec.rb +++ b/test/integration/aio-server-pools/serverspec/bareos_spec.rb @@ -1,28 +1,30 @@ require 'spec_helper' -describe package('bareos-director') do +# Check Packages are installed +describe package('bareos-filedaemon') do it { should be_installed } end -describe service('bareos-dir') do - it { should be_enabled } - it { should be_running } +describe package('bareos-storage') do + it { should be_installed } end -describe package('bareos-storage') do +describe package('bareos-director') do it { should be_installed } end -describe service('bareos-sd') do +# Check Services are running and enabled +describe service('bareos-fd') do it { should be_enabled } it { should be_running } end -describe package('bareos-filedaemon') do - it { should be_installed } +describe service('bareos-sd') do + it { should be_enabled } + it { should be_running } end -describe service('bareos-fd') do +describe service('bareos-dir') do it { should be_enabled } it { should be_running } end diff --git a/test/integration/server/serverspec/spec/spec_helper.rb b/test/integration/aio-server-pools/serverspec/spec/spec_helper.rb similarity index 100% rename from test/integration/server/serverspec/spec/spec_helper.rb rename to test/integration/aio-server-pools/serverspec/spec/spec_helper.rb diff --git a/test/integration/server/serverspec/spec_helper.rb b/test/integration/aio-server-pools/serverspec/spec_helper.rb similarity index 100% rename from test/integration/server/serverspec/spec_helper.rb rename to test/integration/aio-server-pools/serverspec/spec_helper.rb diff --git a/test/integration/aio-server/serverspec/.rspec b/test/integration/aio-server/serverspec/.rspec new file mode 100644 index 0000000..83e16f8 --- /dev/null +++ b/test/integration/aio-server/serverspec/.rspec @@ -0,0 +1,2 @@ +--color +--require spec_helper diff --git a/test/integration/aio-server/serverspec/bareos_spec.rb b/test/integration/aio-server/serverspec/bareos_spec.rb new file mode 100644 index 0000000..b6b14ce --- /dev/null +++ b/test/integration/aio-server/serverspec/bareos_spec.rb @@ -0,0 +1,30 @@ +require 'spec_helper' + +# Check Packages are installed +describe package('bareos-filedaemon') do + it { should be_installed } +end + +describe package('bareos-storage') do + it { should be_installed } +end + +describe package('bareos-director') do + it { should be_installed } +end + +# Check Services are running and enabled +describe service('bareos-fd') do + it { should be_enabled } + it { should be_running } +end + +describe service('bareos-sd') do + it { should be_enabled } + it { should be_running } +end + +describe service('bareos-dir') do + it { should be_enabled } + it { should be_running } +end diff --git a/test/integration/aio-server/serverspec/spec/spec_helper.rb b/test/integration/aio-server/serverspec/spec/spec_helper.rb new file mode 100644 index 0000000..3c0aae9 --- /dev/null +++ b/test/integration/aio-server/serverspec/spec/spec_helper.rb @@ -0,0 +1,89 @@ +# This file was generated by the `rspec --init` command. Conventionally, all +# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. +# The generated `.rspec` file contains `--require spec_helper` which will cause this +# file to always be loaded, without a need to explicitly require it in any files. +# +# Given that it is always loaded, you are encouraged to keep this file as +# light-weight as possible. Requiring heavyweight dependencies from this file +# will add to the boot time of your test suite on EVERY test run, even for an +# individual file that may not need all of that loaded. Instead, consider making +# a separate helper file that requires the additional dependencies and performs +# the additional setup, and require it from the spec files that actually need it. +# +# The `.rspec` file also contains a few flags that are not defaults but that +# users commonly want. +# +# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration +RSpec.configure do |config| + # rspec-expectations config goes here. You can use an alternate + # assertion/expectation library such as wrong or the stdlib/minitest + # assertions if you prefer. + config.expect_with :rspec do |expectations| + # This option will default to `true` in RSpec 4. It makes the `description` + # and `failure_message` of custom matchers include text for helper methods + # defined using `chain`, e.g.: + # be_bigger_than(2).and_smaller_than(4).description + # # => "be bigger than 2 and smaller than 4" + # ...rather than: + # # => "be bigger than 2" + expectations.include_chain_clauses_in_custom_matcher_descriptions = true + end + + # rspec-mocks config goes here. You can use an alternate test double + # library (such as bogus or mocha) by changing the `mock_with` option here. + config.mock_with :rspec do |mocks| + # Prevents you from mocking or stubbing a method that does not exist on + # a real object. This is generally recommended, and will default to + # `true` in RSpec 4. + mocks.verify_partial_doubles = true + end + + # The settings below are suggested to provide a good initial experience + # with RSpec, but feel free to customize to your heart's content. + begin + # These two settings work together to allow you to limit a spec run + # to individual examples or groups you care about by tagging them with + # `:focus` metadata. When nothing is tagged with `:focus`, all examples + # get run. + config.filter_run :focus + config.run_all_when_everything_filtered = true + + # Limits the available syntax to the non-monkey patched syntax that is recommended. + # For more details, see: + # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax + # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ + # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching + config.disable_monkey_patching! + + # This setting enables warnings. It's recommended, but in some cases may + # be too noisy due to issues in dependencies. + config.warnings = true + + # Many RSpec users commonly either run the entire suite or an individual + # file, and it's useful to allow more verbose output when running an + # individual spec file. + if config.files_to_run.one? + # Use the documentation formatter for detailed output, + # unless a formatter has already been configured + # (e.g. via a command-line flag). + config.default_formatter = 'doc' + end + + # Print the 10 slowest examples and example groups at the + # end of the spec run, to help surface which specs are running + # particularly slow. + config.profile_examples = 10 + + # Run specs in random order to surface order dependencies. If you find an + # order dependency and want to debug it, you can fix the order by providing + # the seed, which is printed after each run. + # --seed 1234 + config.order = :random + + # Seed global randomization in this process using the `--seed` CLI option. + # Setting this allows you to use `--seed` to deterministically reproduce + # test failures related to randomization by passing the same `--seed` value + # as the one that triggered the failure. + Kernel.srand config.seed + end +end diff --git a/test/integration/aio-server/serverspec/spec_helper.rb b/test/integration/aio-server/serverspec/spec_helper.rb new file mode 100644 index 0000000..8763eb5 --- /dev/null +++ b/test/integration/aio-server/serverspec/spec_helper.rb @@ -0,0 +1,16 @@ +require 'serverspec' + +set :backend, :exec + +RSpec.configure do |c| + c.before :all do + set :path, '$PATH:/sbin:/usr/local/sbin' + end + + if ENV['ASK_SUDO_PASSWORD'] + require 'highline/import' + c.sudo_password = ask('Enter sudo password: ') { |q| q.echo = false } + else + c.sudo_password = ENV['SUDO_PASSWORD'] + end +end From 4c7cb50febbb74267cbfccc6fa2806497f1fd77b Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Thu, 3 Sep 2015 11:23:13 -0700 Subject: [PATCH 02/40] bumping for testing updates --- metadata.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metadata.rb b/metadata.rb index ec0bea5..c1a0e27 100644 --- a/metadata.rb +++ b/metadata.rb @@ -4,11 +4,11 @@ license 'Apache 2.0' description 'Installs/Configures bareos' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '0.1.3' +version '0.1.4' -supports 'centos', '>= 6.0' supports 'debian', '>= 7.0' supports 'ubuntu', '>= 12.04' +supports 'centos', '>= 6.0' depends 'apt' depends 'openssl' From ab6c195521071a58a86c599f94c1fae129fc4685 Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Thu, 3 Sep 2015 11:29:02 -0700 Subject: [PATCH 03/40] Updating CHANGELOG regarding ChefSpec Tests --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c8c6d4..18c4fe4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ Bareos Cookbook CHANGELOG This file is used to list changes made in each version of the bareos cookbook. +0.1.4 +----- +- Ian smith + + - Updating Kitchen Tests and ChefSpec Configs to match for verifying + * Addressing race condition in ChefSpec tests where debian was taking + longer than expected to start the director 0.1.3 ----- From aa022ceecd5a05c98b4ff7346c99efa48519c64f Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Fri, 26 Jun 2015 13:58:25 -0700 Subject: [PATCH 04/40] more accurate --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f16accd..e18329c 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Attribute | Description |Type | Default ["bareos"]["dbdriver"] | Specify the database driver | string | 'postgresql' ["bareos"]["dbname"] | Specify the database default name | string | 'bareos' ["bareos"]["dbuser"] | Specify the db user name | string | 'bareos' -["bareos"]["dbpassword"] | Specify the db password | string | none/blank +["bareos"]["dbpassword"] | Specify the db password | string | '' ## General @@ -32,7 +32,7 @@ Attribute | Description |Type | Default Attribute | Description |Type | Default -----------------|-------------|-----|-------- -['bareos']['clients'] | Monitor Clients | array | none/blank +['bareos']['clients'] | Monitor Clients | array | [] ['bareos']['tape'] | Enable Tape Features | boolean | false ## Director From 9cf85e49e04e1771429c61c09753ca14020f211f Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Fri, 26 Jun 2015 14:27:55 -0700 Subject: [PATCH 05/40] updating openssl lwrp password generation syntax, was using depricated code --- recipes/client.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/client.rb b/recipes/client.rb index 169eb9f..5fabd6d 100644 --- a/recipes/client.rb +++ b/recipes/client.rb @@ -17,8 +17,8 @@ # limitations under the License. # -node.set_unless['bareos']['fd_password'] = secure_password -node.set_unless['bareos']['mon_password'] = secure_password +node.set_unless['bareos']['fd_password'] = random_password(length: 30, mode: :base64) +node.set_unless['bareos']['mon_password'] = random_password(length: 30, mode: :base64) node.save unless Chef::Config[:solo] # Installation du File daemon BAREOS From 441a68ff205a0d73d852328ed423f20fc37b3ca4 Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Fri, 26 Jun 2015 14:28:02 -0700 Subject: [PATCH 06/40] updating openssl lwrp password generation syntax, was using depricated code --- recipes/server.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/server.rb b/recipes/server.rb index d04d1fa..7d81ccd 100644 --- a/recipes/server.rb +++ b/recipes/server.rb @@ -17,8 +17,8 @@ # limitations under the License. # -node.set_unless['bareos']['dir_password'] = secure_password -node.set_unless['bareos']['mon_password'] = secure_password +node.set_unless['bareos']['dir_password'] = random_password(length: 30, mode: :base64) +node.set_unless['bareos']['mon_password'] = random_password(length: 30, mode: :base64) node.save unless Chef::Config[:solo] # Installation des services BAREOS From 5a56a9ceac5d7d970da18bcf863d162cca0fb093 Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Fri, 26 Jun 2015 14:28:06 -0700 Subject: [PATCH 07/40] updating openssl lwrp password generation syntax, was using depricated code --- recipes/storage.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/storage.rb b/recipes/storage.rb index c6f2c02..f267fcd 100644 --- a/recipes/storage.rb +++ b/recipes/storage.rb @@ -17,7 +17,7 @@ # limitations under the License. # -node.set_unless['bareos']['sd_password'] = secure_password +node.set_unless['bareos']['sd_password'] = random_password(length: 30, mode: :base64) node.save unless Chef::Config[:solo] # Installation du Storage daemon BAREOS From a7fb252c8437df457bd8f39c6ba2e48965c5440a Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Fri, 26 Jun 2015 14:29:06 -0700 Subject: [PATCH 08/40] I don't think the include_recipe bit was really needed just the dependency within the metadata file --- recipes/default.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/default.rb b/recipes/default.rb index b077f59..df4a87a 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -17,10 +17,10 @@ # limitations under the License. # -include_recipe 'openssl::default' - +# Randomly generate ssh passwords for Bareos Daemons ::Chef::Recipe.send(:include, Opscode::OpenSSL::Password) +# Bring in necessary sources for Bareos if platform_family?('rhel') yum_repository node['bareos']['yum_repository'] do description node['bareos']['description'] From 4eb2ea71a19d133dc2b88ad3ac65a6077569b727 Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Fri, 26 Jun 2015 14:30:03 -0700 Subject: [PATCH 09/40] locking in default version of bareos, i saw some potential for database problems if they move to newer version --- attributes/default.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/attributes/default.rb b/attributes/default.rb index da9d36e..da0a9b2 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -1,7 +1,11 @@ # Repository default['bareos']['url'] = 'http://download.bareos.org/bareos/release' -default['bareos']['version'] = 'latest' + + +# Used to have 'latest' as default, had potential update dangers +# default['bareos']['version'] = 'latest' <--- Could be dangerous, ***CAUTION*** +default['bareos']['version'] = '14.2' # <--- Latest version as of 6-26-15 if platform_family?('rhel') default['bareos']['yum_repository'] = 'bareos' @@ -15,7 +19,7 @@ when 'centos' default['bareos']['baseurl'] = "#{node['bareos']['url']}/#{node['bareos']['version']}/CentOS_6/" default['bareos']['gpgkey'] = "#{node['bareos']['url']}/#{node['bareos']['version']}/CentOS_6/repodata/repomd.xml.key" -else +when 'debian' default['bareos']['baseurl'] = "#{node['bareos']['url']}/#{node['bareos']['version']}/Debian_7.0/" default['bareos']['gpgkey'] = "#{node['bareos']['url']}/#{node['bareos']['version']}/Debian_7.0/Release.key" end From d52078f9807935132aa216513a82b8db0967c992 Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Fri, 26 Jun 2015 14:35:10 -0700 Subject: [PATCH 10/40] missed this update to the openssl bits --- recipes/default.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/default.rb b/recipes/default.rb index df4a87a..5fad6d4 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -18,7 +18,7 @@ # # Randomly generate ssh passwords for Bareos Daemons -::Chef::Recipe.send(:include, Opscode::OpenSSL::Password) +::Chef::Recipe.send(:include, OpenSSLCookbook::RandomPassword) # Bring in necessary sources for Bareos if platform_family?('rhel') From 72fe408986ea993c0c54d63caa1d656851e32078 Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Fri, 26 Jun 2015 14:38:04 -0700 Subject: [PATCH 11/40] had extra space at eol --- recipes/server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/server.rb b/recipes/server.rb index 7d81ccd..56e1d8e 100644 --- a/recipes/server.rb +++ b/recipes/server.rb @@ -17,7 +17,7 @@ # limitations under the License. # -node.set_unless['bareos']['dir_password'] = random_password(length: 30, mode: :base64) +node.set_unless['bareos']['dir_password'] = random_password(length: 30, mode: :base64) node.set_unless['bareos']['mon_password'] = random_password(length: 30, mode: :base64) node.save unless Chef::Config[:solo] From de90ddee5c97453946b7a7cc600ad993129dbc10 Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Fri, 26 Jun 2015 14:58:51 -0700 Subject: [PATCH 12/40] blank line detected --- attributes/default.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/attributes/default.rb b/attributes/default.rb index da0a9b2..959434f 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -2,7 +2,6 @@ default['bareos']['url'] = 'http://download.bareos.org/bareos/release' - # Used to have 'latest' as default, had potential update dangers # default['bareos']['version'] = 'latest' <--- Could be dangerous, ***CAUTION*** default['bareos']['version'] = '14.2' # <--- Latest version as of 6-26-15 From e3492e2e169d2d90aa95fc2c251c9e90d74c7913 Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Mon, 29 Jun 2015 08:37:39 -0700 Subject: [PATCH 13/40] breaking out the hosts from the bareos-dir.conf.erb, easier to manage other things --- templates/default/host.conf.erb | 74 +++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 templates/default/host.conf.erb diff --git a/templates/default/host.conf.erb b/templates/default/host.conf.erb new file mode 100644 index 0000000..e41b994 --- /dev/null +++ b/templates/default/host.conf.erb @@ -0,0 +1,74 @@ +<%#Placeholder for host template %> +# Generated by Chef for <%= node['fqdn'] %> +# Local modifications will be overwritten. + +<% @bareos_clients.each do |client| %> +Client { + Name = <%= client['fqdn'] %>-fd + Address = <%= client['fqdn'] %> + Password = "<%= client['bareos']['fd_password'] %>" # password for FileDaemon + File Retention = 30 days + Job Retention = 6 months + AutoPrune = no +} + +JobDefs { + Name = "<%= client['hostname'] %>-Job" + Type = Backup + Level = Incremental + Client = <%= client[:fqdn] %>-fd + FileSet = "Full Set" + Schedule = "WeeklyCycle" + Storage = File + Messages = Standard + Pool = Scratch + FullBackupPool = <%= client['hostname'] %>-Full + IncrementalBackupPool = <%= client['hostname'] %>-Inc + DifferentialBackupPool = <%= client['hostname'] %>-Diff + Priority = 10 + Write Bootstrap = "/var/lib/bareos/%c.bsr" +} + +Job { + Name = "<%= client['hostname'] %>-Save" + JobDefs = "<%= client['hostname'] %>-Job" +} + +Job { + Name = "<%= client['hostname'] %>-Restore" + Type = Restore + Client = <%= client['fqdn'] %>-fd + FileSet= "Full Set" + Storage = File + Pool = <%= client['hostname'] %>-Full + Messages = Standard + Where = /tmp/<%= client['hostname'] %>_restored/ +} + +# Individual host pools for better storage utilization + +Pool { + Name = <%= client['hostname'] %>-Full + Pool Type = Backup + Recycle = yes + AutoPrune = yes + Volume Retention = 1 year +} + +Pool { + Name = <%= client['hostname'] %>-Inc + Pool Type = Backup + Recycle = yes + AutoPrune = yes + Volume Retention = 30 days +} + +Pool { + Name = <%= client['hostname'] %>-Diff + Pool Type = Backup + Recycle = yes + AutoPrune = yes + Volume Retention = 3 months +} + +<% end %> From 796de7451a6970feceb7030f4a036c66f557ab2c Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Mon, 29 Jun 2015 08:39:25 -0700 Subject: [PATCH 14/40] moving hosts configs into seperate directory, a little cleaner this way, keeps dir conf more trimmed down --- recipes/server.rb | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/recipes/server.rb b/recipes/server.rb index 56e1d8e..71cd0f0 100644 --- a/recipes/server.rb +++ b/recipes/server.rb @@ -47,12 +47,36 @@ db_name: node['bareos']['dbname'], db_user: node['bareos']['dbuser'], db_password: node['bareos']['dbpassword'], - bareos_clients: bareos_clients ) - notifies :reload, 'service[bareos-dir]', :immediately end +# Handle seperate host config files +unless Chef::Config[:solo] + + # Create hosts direcotry for host configs + directory '/etc/bareos/bareos-dir.d/hosts/' do + owner 'root' + group 'root' + mode '0755' + action :create + end + + # Populate host config files based on hosts with bareos_base role in runlist + bareos_clients.each do + template "/etc/bareos/bareos-dir.d/hosts/#{node['hostname']}.conf" do + source 'host.conf.erb' + owner 'root' + group 'root' + mode '0644' + variables( + bareos_clients: bareos_clients + ) + notifies :reload, 'service[bareos-dir]', :immediately + end + end +end + service 'bareos-dir' do supports status: true, restart: true, reload: false action [:enable, :start] From a83596c6f68427e1a53fc47721ecbd736b85ab7a Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Mon, 29 Jun 2015 08:40:31 -0700 Subject: [PATCH 15/40] moving hosts configs into seperate directory, a little cleaner this way, keeps dir conf more trimmed down --- templates/default/bareos-dir.conf.erb | 50 ++++----------------------- 1 file changed, 7 insertions(+), 43 deletions(-) diff --git a/templates/default/bareos-dir.conf.erb b/templates/default/bareos-dir.conf.erb index 3121395..3c387aa 100644 --- a/templates/default/bareos-dir.conf.erb +++ b/templates/default/bareos-dir.conf.erb @@ -13,7 +13,7 @@ Director { Job { Name = "<%= node['hostname'] %>-save-catalog" - JobDefs = "<%= node['hostname'] %>-job" + JobDefs = "<%= node['hostname'] %>-Job" Level = Full FileSet="Catalog" Schedule = "WeeklyCycleAfterBackup" @@ -84,48 +84,6 @@ FileSet { } } -<% @bareos_clients.each do |client| %> -Client { - Name = <%= client['fqdn'] %> - Address = <%= client['fqdn'] %> - Password = "<%= client['bareos']['fd_password'] %>" # password for FileDaemon - File Retention = 30 days - Job Retention = 6 months - AutoPrune = no -} - -JobDefs { - Name = "<%= client['hostname'] %>-job" - Type = Backup - Level = Incremental - Client = <%= client[:fqdn] %> - FileSet = "Full Set" - Schedule = "WeeklyCycle" - Storage = File - Messages = Standard - Pool = File - Priority = 10 - Write Bootstrap = "/var/lib/bareos/%c.bsr" -} - -Job { - Name = "<%= client['hostname'] %>-save" - JobDefs = "<%= client['hostname'] %>-job" -} - -Job { - Name = "<%= client['hostname'] %>-restore" - Type = Restore - Client = <%= client['fqdn'] %> - FileSet="Full Set" - Storage = File - Pool = Default - Messages = Standard - Where = / -} - -<% end %> - Storage { Name = File Address = <%= node['fqdn'] %> # N.B. Use a fully qualified name here @@ -195,3 +153,9 @@ Pool { Pool Type = Backup } +########################################################################## +# Other Stuff +########################################################################## + +#working#################### +@|"sh -c 'for f in /etc/bareos/bareos-dir.d/hosts/*.conf ; do echo @${f} ; done'" From 36edd578c3e4f2432434f4e9bcb6f6945418b141 Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Mon, 29 Jun 2015 09:54:02 -0700 Subject: [PATCH 16/40] added some comments to explain why things are generated in this implementation --- templates/default/host.conf.erb | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/templates/default/host.conf.erb b/templates/default/host.conf.erb index e41b994..495098d 100644 --- a/templates/default/host.conf.erb +++ b/templates/default/host.conf.erb @@ -1,7 +1,11 @@ -<%#Placeholder for host template %> +<%# HOST TEMPLATE %> # Generated by Chef for <%= node['fqdn'] %> # Local modifications will be overwritten. +# This host file is generated from a chef search based on +# the bareos_base role or a custom client list in the +# default attributes file of the chef-bareos cookbook + <% @bareos_clients.each do |client| %> Client { Name = <%= client['fqdn'] %>-fd @@ -12,6 +16,8 @@ Client { AutoPrune = no } +# Each client gets its own JobDef to facilitate having +# client based pools JobDefs { Name = "<%= client['hostname'] %>-Job" Type = Backup @@ -29,11 +35,13 @@ JobDefs { Write Bootstrap = "/var/lib/bareos/%c.bsr" } +# Default Job Job { - Name = "<%= client['hostname'] %>-Save" + Name = "<%= client['hostname'] %>-Job" JobDefs = "<%= client['hostname'] %>-Job" } +# Restore Job Job { Name = "<%= client['hostname'] %>-Restore" Type = Restore @@ -45,8 +53,13 @@ Job { Where = /tmp/<%= client['hostname'] %>_restored/ } -# Individual host pools for better storage utilization +# VirtualFull Job +<%# Need some logic here to determine whether to use %> +<%# VirtualFull backups or not %> +# Individual host pools for better storage utilization +<%# Could use some logic here to %> +<%# determine if seperate host pools or not %> Pool { Name = <%= client['hostname'] %>-Full Pool Type = Backup From 9891cac67821f0c31a240055ac5771c7a37dfeab Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Mon, 29 Jun 2015 09:54:20 -0700 Subject: [PATCH 17/40] This is not needed now --- templates/default/bareos-dir.conf.erb | 5 ----- 1 file changed, 5 deletions(-) diff --git a/templates/default/bareos-dir.conf.erb b/templates/default/bareos-dir.conf.erb index 3c387aa..e6885af 100644 --- a/templates/default/bareos-dir.conf.erb +++ b/templates/default/bareos-dir.conf.erb @@ -106,11 +106,6 @@ Console { CommandACL = status, .status } -## -## Clients -## -##@/etc/bareos/clients/*.conf - Messages { Name = Standard mailcommand = "/usr/sbin/bsmtp -h localhost -f \"\(Bareos\) \<%r\>\" -s \"Bareos: %t %e of %c %l\" %r" From fc3e709610ae2bb96ac1e89fc7325b099dd207c8 Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Mon, 29 Jun 2015 15:50:28 -0700 Subject: [PATCH 18/40] making the postgresql cookbook features available and allowing the postgresql cookbook to handle postgresql database creation/configs --- recipes/database.rb | 62 ++++++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 38 deletions(-) diff --git a/recipes/database.rb b/recipes/database.rb index ea20d27..5c8a759 100644 --- a/recipes/database.rb +++ b/recipes/database.rb @@ -23,51 +23,37 @@ database = node['bareos']['database_type'] -if platform_family?('rhel') - database_client_name = database.to_s - database_server_name = "#{database}-server" -else - database_client_name = "#{database}-client" - database_server_name = database.to_s -end - -package database_client_name.to_s do - action :install -end - -package database_server_name.to_s do - action :install -end - -package "bareos-database-#{database}" do - action :install -end +case database +when 'postgresql' + include_recipe 'postgresql::server' -%w(postgresql postgresql-contrib).each do |psql_ubuntu| - package psql_ubuntu do + package "bareos-database-#{database}" do action :install - only_if { node['platform'] == 'ubuntu' && database == 'postgresql' } end -end -if database == 'postgresql' - execute 'initdb' do - case node['platform_family'] - when 'debian' - command %(su postgres -c "usr/lib/postgresql/#{node['postgresql']['version']}/bin/initdb -D /var/lib/pgsql/data") - when 'rhel' - command 'su postgres -c "usr/bin/initdb -D /var/lib/pgsql/data"' - end - action :run - not_if { ::File.exist?('/var/lib/pgsql/data/postgresql.conf') } - not_if { ::File.exist?("/etc/postgresql/#{node['postgresql']['version']}/main/postgresql.conf") } +else + if platform_family?('rhel') + database_client_name = database.to_s + database_server_name = "#{database}-server" + else + database_client_name = "#{database}-client" + database_server_name = database.to_s end - - service 'postgresql' do - supports status: true, restart: true, reload: true - action [:enable, :start] + + package database_client_name.to_s do + action :install end + + package database_server_name.to_s do + action :install + end + + package "bareos-database-#{database}" do + action :install + end +end +if database == 'postgresql' execute 'create_database' do command 'su postgres -c "/usr/lib/bareos/scripts/create_bareos_database" && touch /usr/lib/bareos/.dbcreated' creates '/usr/lib/bareos/.dbcreated' From 55e2f8cda9141379f7c08ee3c22dd499c510c970 Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Mon, 29 Jun 2015 16:09:52 -0700 Subject: [PATCH 19/40] adding attribtue to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e18329c..e37d741 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ Attribute | Description |Type | Default -----------------|-------------|-----|-------- ['bareos']['clients'] | Monitor Clients | array | [] ['bareos']['tape'] | Enable Tape Features | boolean | false +['bareos']['host_pools'] | Seperate Host Pools | boolean | false ## Director From 9c84d96c01ecda21cc558dbcba4cea9587e4d743 Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Mon, 29 Jun 2015 16:10:18 -0700 Subject: [PATCH 20/40] adding attribtue to available attributes --- attributes/default.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/attributes/default.rb b/attributes/default.rb index 959434f..7c354e9 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -32,6 +32,7 @@ # Clients list default['bareos']['clients'] = [] +default['bareos']['host_pools'] = false # Tape default['bareos']['tape'] = false From fd57fe5884587b59a1968b5cfc3eae8404b05b87 Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Mon, 29 Jun 2015 16:53:56 -0700 Subject: [PATCH 21/40] adding new attributes for custom host pool options, attr for vfulls in host config --- README.md | 11 ++++++++++- attributes/default.rb | 5 +++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e37d741..7498575 100644 --- a/README.md +++ b/README.md @@ -29,12 +29,21 @@ Attribute | Description |Type | Default ['bareos']['version'] | Software Version | string | 'latest' ## Storage Daemon +Attribute | Description |Type | Default +-----------------|-------------|-----|-------- +['bareos']['tape'] | Enable Tape Features | boolean | false + +## Clients/Hosts Attribute | Description |Type | Default -----------------|-------------|-----|-------- ['bareos']['clients'] | Monitor Clients | array | [] -['bareos']['tape'] | Enable Tape Features | boolean | false +['bareos']['enable_vfulls'] | Activate basic Virtual Full Backups | boolean | false ['bareos']['host_pools'] | Seperate Host Pools | boolean | false +['bareos']['custom_host_pools'] | Custom Host Pools | boolean | nil +['bareos']['host_full_pool'] | Custom Full Pool | string | 'test-pool-Full' +['bareos']['host_incremental_pool'] | Custom Incremental Pool | string | 'test-pool-Inc' +['bareos']['host_differential_pool'] | Custom Differential Pool | string | 'test-pool-Diff' ## Director diff --git a/attributes/default.rb b/attributes/default.rb index 7c354e9..2355002 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -32,7 +32,12 @@ # Clients list default['bareos']['clients'] = [] +default['bareos']['enable_vfulls'] == false # Needs more work within host template default['bareos']['host_pools'] = false +default['bareos']['custom_host_pools'] = nil +default['bareos']['host_full_pool'] = 'test-pool-Full' +default['bareos']['host_incremental_pool'] = 'test-pool-Inc' +default['bareos']['host_differential_pool'] = 'test-pool-Diff' # Tape default['bareos']['tape'] = false From 59ba00dd5b55f3ec850c6f514738971986184819 Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Mon, 29 Jun 2015 16:54:19 -0700 Subject: [PATCH 22/40] adding new attributes for custom host pool options, attr for vfulls in host config --- attributes/default.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attributes/default.rb b/attributes/default.rb index 2355002..2561762 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -39,7 +39,7 @@ default['bareos']['host_incremental_pool'] = 'test-pool-Inc' default['bareos']['host_differential_pool'] = 'test-pool-Diff' -# Tape +# Storage Daemon default['bareos']['tape'] = false # Director From d8b96c2c9af13f8e954db30ad11feacb27bab394 Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Mon, 29 Jun 2015 16:55:58 -0700 Subject: [PATCH 23/40] changed default catalog job name, more clear-ish, made director node name dynamic to the node it is located on --- templates/default/bareos-dir.conf.erb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/templates/default/bareos-dir.conf.erb b/templates/default/bareos-dir.conf.erb index e6885af..517b382 100644 --- a/templates/default/bareos-dir.conf.erb +++ b/templates/default/bareos-dir.conf.erb @@ -1,5 +1,9 @@ +<%# HOST TEMPLATE %> +# Generated by Chef for <%= node['fqdn'] %> +# Local modifications will be overwritten. + Director { - Name = backup-dir + Name = <%= client['hostname'] %>-dir DIRport = <%= node['bareos']['dir_port'] %> QueryFile = "/usr/lib/bareos/scripts/query.sql" Maximum Concurrent Jobs = <%= node['bareos']['dir_max_concurrent_jobs'] %> @@ -12,7 +16,7 @@ Director { } Job { - Name = "<%= node['hostname'] %>-save-catalog" + Name = "<%= node['hostname'] %>-BareosCatalogJob" JobDefs = "<%= node['hostname'] %>-Job" Level = Full FileSet="Catalog" From c5a3483fc472714028ac8e5fecd5b40f58aad2a6 Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Mon, 29 Jun 2015 16:58:00 -0700 Subject: [PATCH 24/40] updating variables to use hostname instead of fqdn in certain spots, added vfull and custom pool logic --- templates/default/host.conf.erb | 47 ++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/templates/default/host.conf.erb b/templates/default/host.conf.erb index 495098d..ccc20f2 100644 --- a/templates/default/host.conf.erb +++ b/templates/default/host.conf.erb @@ -2,13 +2,11 @@ # Generated by Chef for <%= node['fqdn'] %> # Local modifications will be overwritten. -# This host file is generated from a chef search based on -# the bareos_base role or a custom client list in the -# default attributes file of the chef-bareos cookbook +# Bareos Host Config for <<%= client['hostname'] %>-fd <% @bareos_clients.each do |client| %> Client { - Name = <%= client['fqdn'] %>-fd + Name = <%= client['hostname'] %>-fd Address = <%= client['fqdn'] %> Password = "<%= client['bareos']['fd_password'] %>" # password for FileDaemon File Retention = 30 days @@ -16,21 +14,27 @@ Client { AutoPrune = no } -# Each client gets its own JobDef to facilitate having -# client based pools JobDefs { Name = "<%= client['hostname'] %>-Job" Type = Backup Level = Incremental - Client = <%= client[:fqdn] %>-fd + Client = <%= client['hostname'] %>-fd FileSet = "Full Set" Schedule = "WeeklyCycle" Storage = File Messages = Standard Pool = Scratch +# Each client can have its own Pool to help with certain cases +<% if node['bareos']['host_pools'] == true %> FullBackupPool = <%= client['hostname'] %>-Full IncrementalBackupPool = <%= client['hostname'] %>-Inc DifferentialBackupPool = <%= client['hostname'] %>-Diff +<% else if node['bareos']['host_pools'] == true && node['bareos']['custom_host_pools'] != nil %> + FullBackupPool = <%= node['bareos']['host_full_pool'] %> + IncrementalBackupPool = <%= node['bareos']['host_incremental_pool'] %> + DifferentialBackupPool = <%= node['bareos']['host_differential_pool'] %> +<% else %> +<% end %> Priority = 10 Write Bootstrap = "/var/lib/bareos/%c.bsr" } @@ -45,23 +49,32 @@ Job { Job { Name = "<%= client['hostname'] %>-Restore" Type = Restore - Client = <%= client['fqdn'] %>-fd + Client = <%= client['hostname'] %>-fd FileSet= "Full Set" Storage = File + <% if node['bareos']['host_pools'] == true && node['bareos']['custom_host_pools'] != nil %> + Pool = <%= node['bareos']['host_full_pool'] %> + <% else %> Pool = <%= client['hostname'] %>-Full + <% end %> Messages = Standard Where = /tmp/<%= client['hostname'] %>_restored/ } + <% if node['bareos']['enable_vfulls'] == true %> # VirtualFull Job -<%# Need some logic here to determine whether to use %> -<%# VirtualFull backups or not %> + <%# Need some logic here to determine whether to use %> + <%# VirtualFull backups or not %> + <% end %> + <% if node['bareos']['host_pools'] == true %> # Individual host pools for better storage utilization -<%# Could use some logic here to %> -<%# determine if seperate host pools or not %> Pool { + <% if node['bareos']['host_pools'] == true && node['bareos']['custom_host_pools'] != nil %> + Name = <%= node['bareos']['host_full_pool'] %> + <% else %> Name = <%= client['hostname'] %>-Full + <% end %> Pool Type = Backup Recycle = yes AutoPrune = yes @@ -69,7 +82,11 @@ Pool { } Pool { + <% if node['bareos']['host_pools'] == true && node['bareos']['custom_host_pools'] != nil %> + Name = <%= node['bareos']['host_incremental_pool'] %> + <% else %> Name = <%= client['hostname'] %>-Inc + <% end %> Pool Type = Backup Recycle = yes AutoPrune = yes @@ -77,11 +94,15 @@ Pool { } Pool { + <% if node['bareos']['host_pools'] == true && node['bareos']['custom_host_pools'] != nil %> + Name = <%= node['bareos']['host_differential_pool'] %> + <% else %> Name = <%= client['hostname'] %>-Diff + <% end %> Pool Type = Backup Recycle = yes AutoPrune = yes Volume Retention = 3 months } - + <% end %> <% end %> From 9a3addf696c508d7941ceb680fe3d42eed85d6e7 Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Mon, 29 Jun 2015 17:06:03 -0700 Subject: [PATCH 25/40] missed a typo --- templates/default/host.conf.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/default/host.conf.erb b/templates/default/host.conf.erb index ccc20f2..68357db 100644 --- a/templates/default/host.conf.erb +++ b/templates/default/host.conf.erb @@ -2,7 +2,7 @@ # Generated by Chef for <%= node['fqdn'] %> # Local modifications will be overwritten. -# Bareos Host Config for <<%= client['hostname'] %>-fd +# Bareos Host Config for <%= client['hostname'] %>-fd <% @bareos_clients.each do |client| %> Client { From 2549141044913061df748fabe3f0194205ee14f1 Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Mon, 29 Jun 2015 17:06:28 -0700 Subject: [PATCH 26/40] didnt have client defined, changed to just use node instead --- templates/default/bareos-dir.conf.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/default/bareos-dir.conf.erb b/templates/default/bareos-dir.conf.erb index 517b382..3887a58 100644 --- a/templates/default/bareos-dir.conf.erb +++ b/templates/default/bareos-dir.conf.erb @@ -3,7 +3,7 @@ # Local modifications will be overwritten. Director { - Name = <%= client['hostname'] %>-dir + Name = <%= node['hostname'] %>-dir DIRport = <%= node['bareos']['dir_port'] %> QueryFile = "/usr/lib/bareos/scripts/query.sql" Maximum Concurrent Jobs = <%= node['bareos']['dir_max_concurrent_jobs'] %> From cb50439ac88f96bc91cf191e4365b5608f6d61c0 Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Mon, 29 Jun 2015 17:11:38 -0700 Subject: [PATCH 27/40] had wrong kind of elseif statement --- templates/default/host.conf.erb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/default/host.conf.erb b/templates/default/host.conf.erb index 68357db..09369e8 100644 --- a/templates/default/host.conf.erb +++ b/templates/default/host.conf.erb @@ -2,9 +2,9 @@ # Generated by Chef for <%= node['fqdn'] %> # Local modifications will be overwritten. +<% @bareos_clients.each do |client| %> # Bareos Host Config for <%= client['hostname'] %>-fd -<% @bareos_clients.each do |client| %> Client { Name = <%= client['hostname'] %>-fd Address = <%= client['fqdn'] %> @@ -25,16 +25,16 @@ JobDefs { Messages = Standard Pool = Scratch # Each client can have its own Pool to help with certain cases -<% if node['bareos']['host_pools'] == true %> + <% if node['bareos']['host_pools'] == true %> FullBackupPool = <%= client['hostname'] %>-Full IncrementalBackupPool = <%= client['hostname'] %>-Inc DifferentialBackupPool = <%= client['hostname'] %>-Diff -<% else if node['bareos']['host_pools'] == true && node['bareos']['custom_host_pools'] != nil %> + <% elsif node['bareos']['host_pools'] == true && node['bareos']['custom_host_pools'] != nil %> FullBackupPool = <%= node['bareos']['host_full_pool'] %> IncrementalBackupPool = <%= node['bareos']['host_incremental_pool'] %> DifferentialBackupPool = <%= node['bareos']['host_differential_pool'] %> -<% else %> -<% end %> + <% else %> + <% end %> Priority = 10 Write Bootstrap = "/var/lib/bareos/%c.bsr" } @@ -52,11 +52,11 @@ Job { Client = <%= client['hostname'] %>-fd FileSet= "Full Set" Storage = File - <% if node['bareos']['host_pools'] == true && node['bareos']['custom_host_pools'] != nil %> + <% if node['bareos']['host_pools'] == true && node['bareos']['custom_host_pools'] != nil %> Pool = <%= node['bareos']['host_full_pool'] %> - <% else %> + <% else %> Pool = <%= client['hostname'] %>-Full - <% end %> + <% end %> Messages = Standard Where = /tmp/<%= client['hostname'] %>_restored/ } From b8cfd1ed6093deb2a588e2e59a14c34cc984bcbc Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Tue, 30 Jun 2015 14:10:48 -0700 Subject: [PATCH 28/40] making some changes to this template, already had the for each in the server recipe, i was doubling up, also fixing host pool logic --- templates/default/host.conf.erb | 57 +++++++++++++++++---------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/templates/default/host.conf.erb b/templates/default/host.conf.erb index 09369e8..bc9abea 100644 --- a/templates/default/host.conf.erb +++ b/templates/default/host.conf.erb @@ -2,38 +2,41 @@ # Generated by Chef for <%= node['fqdn'] %> # Local modifications will be overwritten. -<% @bareos_clients.each do |client| %> -# Bareos Host Config for <%= client['hostname'] %>-fd +<%# @bareos_clients.each do |client| %> +# Bareos Host Config for <%= node['hostname'] %>-fd Client { - Name = <%= client['hostname'] %>-fd - Address = <%= client['fqdn'] %> - Password = "<%= client['bareos']['fd_password'] %>" # password for FileDaemon + Name = <%= node['hostname'] %>-fd + Address = <%= node['fqdn'] %> + Password = "<%= node['bareos']['fd_password'] %>" # password for FileDaemon File Retention = 30 days Job Retention = 6 months AutoPrune = no } JobDefs { - Name = "<%= client['hostname'] %>-Job" + Name = "<%= node['hostname'] %>-Job" Type = Backup Level = Incremental - Client = <%= client['hostname'] %>-fd + Client = <%= node['hostname'] %>-fd FileSet = "Full Set" Schedule = "WeeklyCycle" Storage = File Messages = Standard Pool = Scratch -# Each client can have its own Pool to help with certain cases - <% if node['bareos']['host_pools'] == true %> - FullBackupPool = <%= client['hostname'] %>-Full - IncrementalBackupPool = <%= client['hostname'] %>-Inc - DifferentialBackupPool = <%= client['hostname'] %>-Diff - <% elsif node['bareos']['host_pools'] == true && node['bareos']['custom_host_pools'] != nil %> + # Each client can have its own Pool to help with certain cases + <% if node['bareos']['host_pools'] == true && node['bareos']['custom_host_pools'] == true %> FullBackupPool = <%= node['bareos']['host_full_pool'] %> IncrementalBackupPool = <%= node['bareos']['host_incremental_pool'] %> DifferentialBackupPool = <%= node['bareos']['host_differential_pool'] %> + <% elsif node['bareos']['host_pools'] == true %> + FullBackupPool = <%= node['hostname'] %>-Full + IncrementalBackupPool = <%= node['hostname'] %>-Inc + DifferentialBackupPool = <%= node['hostname'] %>-Diff <% else %> + # FullBackupPool = <%= node['bareos']['host_full_pool'] %> + # IncrementalBackupPool = <%= node['bareos']['host_incremental_pool'] %> + # DifferentialBackupPool = <%= node['bareos']['host_differential_pool'] %> <% end %> Priority = 10 Write Bootstrap = "/var/lib/bareos/%c.bsr" @@ -41,24 +44,24 @@ JobDefs { # Default Job Job { - Name = "<%= client['hostname'] %>-Job" - JobDefs = "<%= client['hostname'] %>-Job" + Name = "<%= node['hostname'] %>-Job" + JobDefs = "<%= node['hostname'] %>-Job" } # Restore Job Job { - Name = "<%= client['hostname'] %>-Restore" + Name = "<%= node['hostname'] %>-Restore" Type = Restore - Client = <%= client['hostname'] %>-fd + Client = <%= node['hostname'] %>-fd FileSet= "Full Set" Storage = File - <% if node['bareos']['host_pools'] == true && node['bareos']['custom_host_pools'] != nil %> + <% if node['bareos']['host_pools'] == true && node['bareos']['custom_host_pools'] == true %> Pool = <%= node['bareos']['host_full_pool'] %> - <% else %> - Pool = <%= client['hostname'] %>-Full + <% elsif node['bareos']['host_pools'] == true %> + Pool = <%= node['hostname'] %>-Full <% end %> Messages = Standard - Where = /tmp/<%= client['hostname'] %>_restored/ + Where = /tmp/<%= node['hostname'] %>_restored/ } <% if node['bareos']['enable_vfulls'] == true %> @@ -70,10 +73,10 @@ Job { <% if node['bareos']['host_pools'] == true %> # Individual host pools for better storage utilization Pool { - <% if node['bareos']['host_pools'] == true && node['bareos']['custom_host_pools'] != nil %> + <% if node['bareos']['custom_host_pools'] == true %> Name = <%= node['bareos']['host_full_pool'] %> <% else %> - Name = <%= client['hostname'] %>-Full + Name = <%= node['hostname'] %>-Full <% end %> Pool Type = Backup Recycle = yes @@ -82,10 +85,10 @@ Pool { } Pool { - <% if node['bareos']['host_pools'] == true && node['bareos']['custom_host_pools'] != nil %> + <% if node['bareos']['custom_host_pools'] == true %> Name = <%= node['bareos']['host_incremental_pool'] %> <% else %> - Name = <%= client['hostname'] %>-Inc + Name = <%= node['hostname'] %>-Inc <% end %> Pool Type = Backup Recycle = yes @@ -94,10 +97,10 @@ Pool { } Pool { - <% if node['bareos']['host_pools'] == true && node['bareos']['custom_host_pools'] != nil %> + <% if node['bareos']['custom_host_pools'] == true %> Name = <%= node['bareos']['host_differential_pool'] %> <% else %> - Name = <%= client['hostname'] %>-Diff + Name = <%= node['hostname'] %>-Diff <% end %> Pool Type = Backup Recycle = yes From 91495dfad28fcd2d9ea2f3a9e75aafb079f86f4b Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Tue, 30 Jun 2015 14:16:23 -0700 Subject: [PATCH 29/40] fixing some rubocop blips --- attributes/default.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/attributes/default.rb b/attributes/default.rb index 2561762..134aef4 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -32,9 +32,9 @@ # Clients list default['bareos']['clients'] = [] -default['bareos']['enable_vfulls'] == false # Needs more work within host template +default['bareos']['enable_vfulls'] = false # Needs more work within host template default['bareos']['host_pools'] = false -default['bareos']['custom_host_pools'] = nil +default['bareos']['custom_host_pools'] = false default['bareos']['host_full_pool'] = 'test-pool-Full' default['bareos']['host_incremental_pool'] = 'test-pool-Inc' default['bareos']['host_differential_pool'] = 'test-pool-Diff' From faeb7fdf35732295d03c35def35aac66087b6a32 Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Tue, 30 Jun 2015 14:16:28 -0700 Subject: [PATCH 30/40] fixing some rubocop blips --- recipes/server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/server.rb b/recipes/server.rb index 71cd0f0..89e7295 100644 --- a/recipes/server.rb +++ b/recipes/server.rb @@ -46,7 +46,7 @@ db_driver: node['bareos']['dbdriver'], db_name: node['bareos']['dbname'], db_user: node['bareos']['dbuser'], - db_password: node['bareos']['dbpassword'], + db_password: node['bareos']['dbpassword'] ) notifies :reload, 'service[bareos-dir]', :immediately end From 7b84da340d1d7583bccfae4928412ea9ac150e06 Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Tue, 30 Jun 2015 14:16:35 -0700 Subject: [PATCH 31/40] fixing some rubocop blips --- recipes/database.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/database.rb b/recipes/database.rb index 5c8a759..868863a 100644 --- a/recipes/database.rb +++ b/recipes/database.rb @@ -39,15 +39,15 @@ database_client_name = "#{database}-client" database_server_name = database.to_s end - + package database_client_name.to_s do action :install end - + package database_server_name.to_s do action :install end - + package "bareos-database-#{database}" do action :install end From 1c02251a46387093ec643e7be2117147011c0168 Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Tue, 30 Jun 2015 14:41:20 -0700 Subject: [PATCH 32/40] too zealous on the erb end bits --- templates/default/host.conf.erb | 41 +++++++++++++++++---------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/templates/default/host.conf.erb b/templates/default/host.conf.erb index bc9abea..3631e9b 100644 --- a/templates/default/host.conf.erb +++ b/templates/default/host.conf.erb @@ -25,19 +25,19 @@ JobDefs { Messages = Standard Pool = Scratch # Each client can have its own Pool to help with certain cases - <% if node['bareos']['host_pools'] == true && node['bareos']['custom_host_pools'] == true %> +<% if node['bareos']['host_pools'] == true && node['bareos']['custom_host_pools'] == true %> FullBackupPool = <%= node['bareos']['host_full_pool'] %> IncrementalBackupPool = <%= node['bareos']['host_incremental_pool'] %> DifferentialBackupPool = <%= node['bareos']['host_differential_pool'] %> - <% elsif node['bareos']['host_pools'] == true %> +<% elsif node['bareos']['host_pools'] == true %> FullBackupPool = <%= node['hostname'] %>-Full IncrementalBackupPool = <%= node['hostname'] %>-Inc DifferentialBackupPool = <%= node['hostname'] %>-Diff - <% else %> +<% else %> # FullBackupPool = <%= node['bareos']['host_full_pool'] %> # IncrementalBackupPool = <%= node['bareos']['host_incremental_pool'] %> # DifferentialBackupPool = <%= node['bareos']['host_differential_pool'] %> - <% end %> +<% end %> Priority = 10 Write Bootstrap = "/var/lib/bareos/%c.bsr" } @@ -55,29 +55,31 @@ Job { Client = <%= node['hostname'] %>-fd FileSet= "Full Set" Storage = File - <% if node['bareos']['host_pools'] == true && node['bareos']['custom_host_pools'] == true %> +<% if node['bareos']['host_pools'] == true && node['bareos']['custom_host_pools'] == true %> Pool = <%= node['bareos']['host_full_pool'] %> - <% elsif node['bareos']['host_pools'] == true %> +<% elsif node['bareos']['host_pools'] == true %> Pool = <%= node['hostname'] %>-Full - <% end %> +<% else %> + Pool = Default +<% end %> Messages = Standard Where = /tmp/<%= node['hostname'] %>_restored/ } - <% if node['bareos']['enable_vfulls'] == true %> +<% if node['bareos']['enable_vfulls'] == true %> # VirtualFull Job <%# Need some logic here to determine whether to use %> <%# VirtualFull backups or not %> - <% end %> +<% end %> - <% if node['bareos']['host_pools'] == true %> +<% if node['bareos']['host_pools'] == true %> # Individual host pools for better storage utilization Pool { - <% if node['bareos']['custom_host_pools'] == true %> + <% if node['bareos']['custom_host_pools'] == true %> Name = <%= node['bareos']['host_full_pool'] %> - <% else %> + <% else %> Name = <%= node['hostname'] %>-Full - <% end %> + <% end %> Pool Type = Backup Recycle = yes AutoPrune = yes @@ -85,11 +87,11 @@ Pool { } Pool { - <% if node['bareos']['custom_host_pools'] == true %> + <% if node['bareos']['custom_host_pools'] == true %> Name = <%= node['bareos']['host_incremental_pool'] %> - <% else %> + <% else %> Name = <%= node['hostname'] %>-Inc - <% end %> + <% end %> Pool Type = Backup Recycle = yes AutoPrune = yes @@ -97,15 +99,14 @@ Pool { } Pool { - <% if node['bareos']['custom_host_pools'] == true %> + <% if node['bareos']['custom_host_pools'] == true %> Name = <%= node['bareos']['host_differential_pool'] %> - <% else %> + <% else %> Name = <%= node['hostname'] %>-Diff - <% end %> + <% end %> Pool Type = Backup Recycle = yes AutoPrune = yes Volume Retention = 3 months } - <% end %> <% end %> From deccc900a832ad5f43340592af160f2221641882 Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Tue, 30 Jun 2015 16:00:56 -0700 Subject: [PATCH 33/40] added some more dynamic bits for the client/bareos-fd template --- recipes/client.rb | 9 +++++++++ templates/default/bareos-fd.conf.erb | 22 +++++++++++++++------- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/recipes/client.rb b/recipes/client.rb index 5fabd6d..718a2c3 100644 --- a/recipes/client.rb +++ b/recipes/client.rb @@ -27,11 +27,20 @@ action :install end +if Chef::Config[:solo] + bareos_server = node['bareos']['server'] +else + bareos_server = search(:node, 'role:bareos_server') +end + template '/etc/bareos/bareos-fd.conf' do source 'bareos-fd.conf.erb' owner 'root' group 'bareos' mode '0640' + variables( + bareos_server: bareos_server + ) notifies :reload, 'service[bareos-fd]', :immediately end diff --git a/templates/default/bareos-fd.conf.erb b/templates/default/bareos-fd.conf.erb index b65e000..a01770c 100644 --- a/templates/default/bareos-fd.conf.erb +++ b/templates/default/bareos-fd.conf.erb @@ -1,20 +1,28 @@ +<%# FILE DAEMON TEMPLATE %> +# Generated by Chef for <%= node['fqdn'] %> +# Local modifications will be overwritten. + +FileDaemon { + Name = <%= node['hostname'] %>-fd + Maximum Concurrent Jobs = 20 +} + +<% @bareos_server.each do |server| %> + Director { - Name = backup-dir + Name = <%= server['hostname'] %>-dir Password = "<%= node['bareos']['fd_password'] %>" } Director { - Name = bareos-mon + Name = <%= server['hostname'] %>-mon Password = "<%= node['bareos']['mon_password'] %>" Monitor = yes } -FileDaemon { - Name = <%= node['hostname'] %>-fd - Maximum Concurrent Jobs = 20 -} - Messages { Name = Standard director = backup-dir = all, !skipped, !restored } + +<% end %> From 10e780258d5fc77c7919d320e907cdef1b1679fa Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Tue, 30 Jun 2015 16:02:18 -0700 Subject: [PATCH 34/40] redesigned the dynamic erb bits for the storage config --- recipes/storage.rb | 6 +++--- templates/default/bareos-sd.conf.erb | 20 +++++++++----------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/recipes/storage.rb b/recipes/storage.rb index f267fcd..10bf830 100644 --- a/recipes/storage.rb +++ b/recipes/storage.rb @@ -33,9 +33,9 @@ # end if Chef::Config[:solo] - bareos_clients = node['bareos']['clients'] + bareos_server = node['bareos']['server'] else - bareos_clients = search(:node, 'NOT role:bareos_server') + bareos_server = search(:node, 'role:bareos_server') end template '/etc/bareos/bareos-sd.conf' do @@ -44,7 +44,7 @@ owner 'bareos' group 'bareos' variables( - bareos_clients: bareos_clients + bareos_server: bareos_server ) notifies :reload, 'service[bareos-dir]', :immediately end diff --git a/templates/default/bareos-sd.conf.erb b/templates/default/bareos-sd.conf.erb index c7ef3e1..3d57a26 100644 --- a/templates/default/bareos-sd.conf.erb +++ b/templates/default/bareos-sd.conf.erb @@ -1,23 +1,21 @@ +<%# STORAGE DAEMON TEMPLATE %> +# Generated by Chef for <%= node['fqdn'] %> +# Local modifications will be overwritten. + Storage { - Name = backup-sd + Name = <%= node['hostname'] %>-sd Maximum Concurrent Jobs = 20 } Director { - Name = backup-dir + Name = <%= node['hostname'] %>-dir Password = "<%= node['bareos']['sd_password'] %>" } +<% @bareos_server.each do |server| %> Director { - Name = backup-mon - Password = "<%= node['bareos']['mon_password'] %>" - Monitor = yes -} - -<% @bareos_clients.each do |client| %> -Director { - Name = <%= client['fqdn'] %> - Password = "<%= client['bareos']['mon_password'] %>" + Name = <%= server['hostname'] %>-mon + Password = "<%= server['bareos']['mon_password'] %>" Monitor = yes } <% end %> From 6a84be188d30f7acd8773c65bb91b31bfa17bfa5 Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Tue, 30 Jun 2015 16:02:49 -0700 Subject: [PATCH 35/40] fixed header and renamed catalog job --- templates/default/bareos-dir.conf.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/default/bareos-dir.conf.erb b/templates/default/bareos-dir.conf.erb index 3887a58..91a73c9 100644 --- a/templates/default/bareos-dir.conf.erb +++ b/templates/default/bareos-dir.conf.erb @@ -1,4 +1,4 @@ -<%# HOST TEMPLATE %> +<%# DIRECTOR TEMPLATE %> # Generated by Chef for <%= node['fqdn'] %> # Local modifications will be overwritten. @@ -16,7 +16,7 @@ Director { } Job { - Name = "<%= node['hostname'] %>-BareosCatalogJob" + Name = "<%= node['hostname'] %>-BackupCatalog" JobDefs = "<%= node['hostname'] %>-Job" Level = Full FileSet="Catalog" From dd9b288103717ba0154e956019f0377278891ada Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Tue, 30 Jun 2015 16:21:34 -0700 Subject: [PATCH 36/40] adding summary of what I have changed since last version bump --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18c4fe4..073ad81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,19 @@ This file is used to list changes made in each version of the bareos cookbook. * Addressing race condition in ChefSpec tests where debian was taking longer than expected to start the director +0.1.4 +----- +- Ian smith + + - Updating README + - Revamping server.rb recipe to better utilize the bareos-dir.d directory + * Moving ALL host config files to the bareos-dir.d/hosts/ directory + * Revamping director config and moving host bits to seperate host.conf.erb template + * Adding feature for host based custom pools based on true/false attribute + * Adding ability to fill in a block for virtual-full backup logic (not complete yet) + - Revamping storage.rb and storage template to what I am thinking was meant to happen originally + - Bugfixes + 0.1.3 ----- - Ian smith From d56d9d4bb8645f624d7bef0f0de075faa364fd4c Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Tue, 30 Jun 2015 16:24:24 -0700 Subject: [PATCH 37/40] adding more tests for new test suite --- .../server-host-pools/serverspec/.rspec | 2 + .../serverspec/bareos_spec.rb | 28 ++++++ .../serverspec/spec/spec_helper.rb | 89 +++++++++++++++++++ .../serverspec/spec_helper.rb | 16 ++++ 4 files changed, 135 insertions(+) create mode 100644 test/integration/server-host-pools/serverspec/.rspec create mode 100644 test/integration/server-host-pools/serverspec/bareos_spec.rb create mode 100644 test/integration/server-host-pools/serverspec/spec/spec_helper.rb create mode 100644 test/integration/server-host-pools/serverspec/spec_helper.rb diff --git a/test/integration/server-host-pools/serverspec/.rspec b/test/integration/server-host-pools/serverspec/.rspec new file mode 100644 index 0000000..83e16f8 --- /dev/null +++ b/test/integration/server-host-pools/serverspec/.rspec @@ -0,0 +1,2 @@ +--color +--require spec_helper diff --git a/test/integration/server-host-pools/serverspec/bareos_spec.rb b/test/integration/server-host-pools/serverspec/bareos_spec.rb new file mode 100644 index 0000000..bc63088 --- /dev/null +++ b/test/integration/server-host-pools/serverspec/bareos_spec.rb @@ -0,0 +1,28 @@ +require 'spec_helper' + +describe package('bareos-director') do + it { should be_installed } +end + +describe service('bareos-dir') do + it { should be_enabled } + it { should be_running } +end + +describe package('bareos-storage') do + it { should be_installed } +end + +describe service('bareos-sd') do + it { should be_enabled } + it { should be_running } +end + +describe package('bareos-filedaemon') do + it { should be_installed } +end + +describe service('bareos-fd') do + it { should be_enabled } + it { should be_running } +end diff --git a/test/integration/server-host-pools/serverspec/spec/spec_helper.rb b/test/integration/server-host-pools/serverspec/spec/spec_helper.rb new file mode 100644 index 0000000..3c0aae9 --- /dev/null +++ b/test/integration/server-host-pools/serverspec/spec/spec_helper.rb @@ -0,0 +1,89 @@ +# This file was generated by the `rspec --init` command. Conventionally, all +# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. +# The generated `.rspec` file contains `--require spec_helper` which will cause this +# file to always be loaded, without a need to explicitly require it in any files. +# +# Given that it is always loaded, you are encouraged to keep this file as +# light-weight as possible. Requiring heavyweight dependencies from this file +# will add to the boot time of your test suite on EVERY test run, even for an +# individual file that may not need all of that loaded. Instead, consider making +# a separate helper file that requires the additional dependencies and performs +# the additional setup, and require it from the spec files that actually need it. +# +# The `.rspec` file also contains a few flags that are not defaults but that +# users commonly want. +# +# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration +RSpec.configure do |config| + # rspec-expectations config goes here. You can use an alternate + # assertion/expectation library such as wrong or the stdlib/minitest + # assertions if you prefer. + config.expect_with :rspec do |expectations| + # This option will default to `true` in RSpec 4. It makes the `description` + # and `failure_message` of custom matchers include text for helper methods + # defined using `chain`, e.g.: + # be_bigger_than(2).and_smaller_than(4).description + # # => "be bigger than 2 and smaller than 4" + # ...rather than: + # # => "be bigger than 2" + expectations.include_chain_clauses_in_custom_matcher_descriptions = true + end + + # rspec-mocks config goes here. You can use an alternate test double + # library (such as bogus or mocha) by changing the `mock_with` option here. + config.mock_with :rspec do |mocks| + # Prevents you from mocking or stubbing a method that does not exist on + # a real object. This is generally recommended, and will default to + # `true` in RSpec 4. + mocks.verify_partial_doubles = true + end + + # The settings below are suggested to provide a good initial experience + # with RSpec, but feel free to customize to your heart's content. + begin + # These two settings work together to allow you to limit a spec run + # to individual examples or groups you care about by tagging them with + # `:focus` metadata. When nothing is tagged with `:focus`, all examples + # get run. + config.filter_run :focus + config.run_all_when_everything_filtered = true + + # Limits the available syntax to the non-monkey patched syntax that is recommended. + # For more details, see: + # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax + # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ + # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching + config.disable_monkey_patching! + + # This setting enables warnings. It's recommended, but in some cases may + # be too noisy due to issues in dependencies. + config.warnings = true + + # Many RSpec users commonly either run the entire suite or an individual + # file, and it's useful to allow more verbose output when running an + # individual spec file. + if config.files_to_run.one? + # Use the documentation formatter for detailed output, + # unless a formatter has already been configured + # (e.g. via a command-line flag). + config.default_formatter = 'doc' + end + + # Print the 10 slowest examples and example groups at the + # end of the spec run, to help surface which specs are running + # particularly slow. + config.profile_examples = 10 + + # Run specs in random order to surface order dependencies. If you find an + # order dependency and want to debug it, you can fix the order by providing + # the seed, which is printed after each run. + # --seed 1234 + config.order = :random + + # Seed global randomization in this process using the `--seed` CLI option. + # Setting this allows you to use `--seed` to deterministically reproduce + # test failures related to randomization by passing the same `--seed` value + # as the one that triggered the failure. + Kernel.srand config.seed + end +end diff --git a/test/integration/server-host-pools/serverspec/spec_helper.rb b/test/integration/server-host-pools/serverspec/spec_helper.rb new file mode 100644 index 0000000..8763eb5 --- /dev/null +++ b/test/integration/server-host-pools/serverspec/spec_helper.rb @@ -0,0 +1,16 @@ +require 'serverspec' + +set :backend, :exec + +RSpec.configure do |c| + c.before :all do + set :path, '$PATH:/sbin:/usr/local/sbin' + end + + if ENV['ASK_SUDO_PASSWORD'] + require 'highline/import' + c.sudo_password = ask('Enter sudo password: ') { |q| q.echo = false } + else + c.sudo_password = ENV['SUDO_PASSWORD'] + end +end From 0e336613e68bda1f7c079091c4374a2526b3e1d4 Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Tue, 30 Jun 2015 16:25:23 -0700 Subject: [PATCH 38/40] adding a line item to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 073ad81..f0b5321 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ This file is used to list changes made in each version of the bareos cookbook. * Adding feature for host based custom pools based on true/false attribute * Adding ability to fill in a block for virtual-full backup logic (not complete yet) - Revamping storage.rb and storage template to what I am thinking was meant to happen originally + - Adding new kitchen suite and tests to verify host pools work - Bugfixes 0.1.3 From c44521905ecf3f948905caefa26f958c71ce348a Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Mon, 29 Jun 2015 15:48:53 -0700 Subject: [PATCH 39/40] added a prerun recipe to update apt cache --- .kitchen.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.kitchen.yml b/.kitchen.yml index a4ae4f7..d485454 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -8,12 +8,15 @@ provisioner: platforms: - name: debian-7.8 + - name: ubuntu-12.04 run_list: - recipe[apt] + - name: ubuntu-14.04 run_list: - recipe[apt] + - name: centos-6.7 data_bags_path: test/integration/data_bags/ From cc21d62d184cddb96ffa29f5c7db65195ed870b4 Mon Sep 17 00:00:00 2001 From: Ian Smith Date: Thu, 3 Sep 2015 11:53:58 -0700 Subject: [PATCH 40/40] wow...that got messy --- CHANGELOG.md | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48ab868..914eaea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,28 +3,6 @@ Bareos Cookbook CHANGELOG This file is used to list changes made in each version of the bareos cookbook. -0.1.4 ------ -- Ian smith - - - Updating Kitchen Tests and ChefSpec Configs to match for verifying - * Addressing race condition in ChefSpec tests where debian was taking - longer than expected to start the director - -0.1.4 ------ -- Ian smith - - - Updating README - - Revamping server.rb recipe to better utilize the bareos-dir.d directory - * Moving ALL host config files to the bareos-dir.d/hosts/ directory - * Revamping director config and moving host bits to seperate host.conf.erb template - * Adding feature for host based custom pools based on true/false attribute - * Adding ability to fill in a block for virtual-full backup logic (not complete yet) - - Revamping storage.rb and storage template to what I am thinking was meant to happen originally - - Adding new kitchen suite and tests to verify host pools work - - Bugfixes - 0.1.4 ----- - Ian smith @@ -38,6 +16,9 @@ This file is used to list changes made in each version of the bareos cookbook. - Revamping storage.rb and storage template to what I am thinking was meant to happen originally - Adding new kitchen suite and tests to verify host pools work - Bugfixes + - Updating Kitchen Tests and ChefSpec Configs to match for verifying + * Addressing race condition in ChefSpec tests where debian was taking + longer than expected to start the director 0.1.3 -----