Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status


chef-bareos (3) Versions 3.0.3

Installs/Configures BAREOS - Backup Archiving REcovery Open Sourced

cookbook 'chef-bareos', '~> 3.0.3', :supermarket
cookbook 'chef-bareos', '~> 3.0.3'
knife supermarket install chef-bareos
knife supermarket download chef-bareos
Quality 17%

Chef-Bareos Cookbook

Join the chat at

This cookbook installs and configures backups based on BAREOS.

Official BAREOS Documentation.

Supported Platforms:

  • Ubuntu 14.04 (plan to add 16.04 as soon as binary is released)
  • Debian 7 (8+ may or may not work, you'll need a repo basically)
  • CentOS 6+
  • RHEL 6+ (Assumed to work just as well as on CentOS)

Supported Chef Versions:

  • Chef 11+

Important Notable Attributes


Assists with adding necessary sources for installing Bareos

Attribute Default Value Description
['bareos']['url'] '' Main installation URL
['bareos']['contrib_url'] '' Main contrib installation URL
['bareos']['version'] '15.2' Default Bareos Version

For other platform specific attributes please see default attributes file for more detail.


Defines default admin e-mail address for service notifications and what messages to care about

Attribute Default Value Description
['bareos']['messages']['mail_to'] "bareos@#{node['domain']}" Default messages e-mail destination
['bareos']['messages']['default_messages'] 'Standard' Default client message capture level
['bareos']['messages']['default_admin_messages'] 'all, !skipped, !restored' Default server message capture level


Populates the Catalog resource in the main Director configuration

Attribute Default Value Description
['bareos']['database']['catalog_name'] 'MyCatalog' Default catalog name
['bareos']['database']['database_type'] 'postgresql' Default database installment indicator
['bareos']['database']['dbdriver'] 'postgresql' Config entry for type of database
['bareos']['database']['dbname'] 'bareos' Default database name
['bareos']['database']['dbuser'] 'bareos' Default database user
['bareos']['database']['dbpassword'] blank string Default gets generated by postgresql cookbook, unless specified here
['bareos']['database']['dbaddress'] nil This is often just the localhost, so this is only needed in certain cases


Provides resources for the Catalog (Director configuration) and Filedaemon configurations/templates

Attribute Default Value Description
['bareos']['clients']['name'] node['fqdn'] Uses the node FQDN by default as prefix for filedaemon name
['bareos']['clients']['net_name'] node['fqdn'] DNS Network name used to resolve client
['bareos']['clients']['fd_port'] 9102 Default filedaemon port
['bareos']['clients']['max_concurrent_jobs'] 20 Default number of concurrent jobs
['bareos']['clients']['heartbeat_interval'] 600 Proven a useful default value, change as needed
['bareos']['clients']['client_search_query'] 'roles:bareos_client' Default search query to find Bareos clients
['bareos']['clients']['client_list'] %w(node) Useful if you need a list of hosts if running in solo mode
['bareos']['clients']['bootstrap_file'] '/var/lib/bareos/%c.bsr' Default bootstrap file structure/location
['bareos']['clients']['jobdef_default_messages'] 'Standard' Default value for setting the message level in a job definition to override the messages section
['bareos']['clients']['jobdef_default_fileset'] "#{node['fqdn']}-Fileset" Default naming convention for filesets
['bareos']['clients']['storage'] 'File' Default storage for new clients when added via search

Storage Daemon

Provides for a baseline Storage Daemon Config with configurable options

Attribute Default Value Description
default['bareos']['storage']['name'] node['fqdn'] Uses FQDN for naming storages found via search
default['bareos']['storage']['storage_search_query'] 'roles:bareos_storage' Default search query string for finding storage servers
default['bareos']['storage']['sd_port'] 9103 Default Storage communication port
default['bareos']['storage']['servers'] %w(node) List of storage servers you can use if using solo mode
default['bareos']['storage']['max_concurrent_jobs'] 20 Default max number of concurrent storage daemon jobs
default['bareos']['storage']['autochanger_enabled'] false Used to control autochanger support


Provides standard variables for a typical Director configuration

Attribute Default Value Description
default['bareos']['director']['name'] node['fqdn'] Uses FQDN for director naming
default['bareos']['director']['net_name'] node['fqdn'] Uses FQDN for DNS resolution
default['bareos']['director']['dir_search_query'] 'roles:bareos_director' Default search string to find bareos directors
default['bareos']['director']['dir_port'] 9101 Default director communication port
default['bareos']['director']['dir_max_concurrent_jobs'] 20 Default max allowable jobs running
default['bareos']['director']['servers'] %w(node) List of directors if running in solo mode
default['bareos']['director']['console_commandacl'] 'status, .status' Default ACL for console commands
default['bareos']['director']['heartbeat_interval'] 600 Proven useful as a default network timeout for communication to director
default['bareos']['director']['catalog_jobdef'] 'default-catalog-def' Default name for the Catalog Backup Jobdef name
default['bareos']['director']['conf']['help']['Example Block'] '# You can put extra configs here.' Area where you can add any number of possible things to expand your configs
default['bareos']['director']['config_change_notify'] 'restart' Default action when director config changes (restart/reload)

Subscription Management (Director)

Provides a system counter method if you have a paid service subscription

Attribute Default Value Description
['bareos']['director']['dir_subscription'] nil Required if you have a support contract/licensed installation (activates if not nil)
['bareos']['director']['dir_subs'] nil Max number of subs you have signed up for


Determines if you want to use FQDN or some other way of defining hosts in your management workstation deployment

Attribute Default Value Description
['bareos']['workstation']['name'] node['fqdn'] Used to determine header information for bconsole/bat configs

Graphite Plugin

A new plugin that will send statistics to a graphite server which can then be used in various ways.

Attribute Default Value Description
['bareos']['plugins']['graphite']['plugin_path'] '/usr/sbin' Default location for the plugin that runs in a defined cron job
['bareos']['plugins']['graphite']['config_path'] '/etc/bareos' Default directory for the plugin config
['bareos']['plugins']['graphite']['search_query'] 'roles:bareos_director' Default search string to populate the director name
['bareos']['plugins']['graphite']['server'] 'graphite' Placeholder string for the graphite server DNS name
['bareos']['plugins']['graphite']['graphite_port'] '2003' Default graphite communication port
['bareos']['plugins']['graphite']['graphite_data_prefix'] 'bareos.' Default prefix for graphite data
['bareos']['plugins']['graphite']['graphite_plugin_src_url'] See attributes file Default URL to the plugin



Installs the Bareos repos (via the repo recipe) and the client filedaemon (via the client recipe). Please NOTE, although it will install these parts, the director will not pick up on the client unless you (by default) create and attach a bareos_client role to hosts you wish to configure automatically. You can also add the host to the director in the unmanaged-host key value hashes.


Installs the Bareos filedaemon and creates a config file that is linked to available directors on chef server.
You may also feed directors to the config via attributes if running in solo mode.


Installs base Bareos repo as well as the Bareos Contrib repo.


Installs whichever database is desired per attributes (PostgreSQL/MySQL), installs Bareos database packages and creates the bareos database and user for you. Should also set the database password by default. You may need to recover this from the attributes or set a new one via vault via wrapper recipe.


Installs necessary Bareos server packages and sets up base configs necessary for server to start. Also creates the config directory (bareos-dir.d) so you can drop whatever outside config files into place and have them get automatically included in your setup.


Installs necessary Bareos storage packages and sets up a default file storage for you to start backing stuff up to right away (configured for ~250GB spread over 25 10GB volumes).


This bit will setup an autochanger based on a pretty straight forward has table. Tested with IBM TS3500 Tape Library with 10 Frames and 16 Tape drives.


Installs the bconsole utility. There are future plans to create a recipe to install bat (Bareos Administration Tool) and the Bareos Web UI.


Installs a Bareos graphite plugin, configuration file, necessary python packages, and a cronjob to gather statistics periodically and forward them to an available graphite server.

Searchable Roles (Used by default)


This example shows how the bareos_client role can both install the Bareos client side software and when searched against via the server recipe, will add itself to the bareos-dir (Bareos director) configuration and setup a default set of jobs for a client.

  "name": "bareos_client",
  "description": "Example Role for Bareos clients using the chef-bareos Cookbook, used in searches, throws down sources for installs",
  "json_class": "Chef::Role",
  "default_attributes": {
  "override_attributes": {
  "chef_type": "role",
  "run_list": [
  "env_run_lists": {


This example shows a bareos_storage role which will create a Bareos storage-daemon host. It will install the necessary packages and lay down configuration files you can populate with any number of key value hash tables. You should be able to install this independent of the director(s), please file a ticket if this doesn't work as expected.

  "name": "bareos_storage",
  "description": "Example Role for a Bareos storage",
  "json_class": "Chef::Role",
  "default_attributes": {
  "override_attributes": {
  "chef_type": "role",
  "run_list": [
  "env_run_lists": {


This role example will install an all-in-one Bareos director server. This includes a "first" client, bareos database, bareos storage, and deploy bconsole to interact with the director.

This will also allow clients to populate their filedaemon config via defined search string.

You'll need to run chef-client on the director after a client gets configured so the director can add and generate the appropriate client related configs.

You can populate the ['bareos']['clients']['unmanaged'] hash table space with any number of client related configuration lines if you have hosts you either don't plan to search for or want to do custom configurations for.

  "name": "bareos_director",
  "description": "Example Role for a Bareos director",
  "json_class": "Chef::Role",
  "default_attributes": {
  "override_attributes": {
  "chef_type": "role",
  "run_list": [
  "env_run_lists": {

Example customizable key value hash template configurations

These are the preset default hashes to get a baseline configuration on a new bareos server. You can manipulate these as you see fit via recipe logic or searches or whatever you want. These will at least get you going.


# Default Client Config populated via search
default['bareos']['clients']['conf'] = {
  'FDPort' => '9102',
  'File Retention' => '30 days',
  'Job Retention' => '6 months',
  'AutoPrune' => 'yes',
  'Maximum Concurrent Jobs' => '20'
# Example Unmanaged client if client is unmanaged or custom
default['bareos']['clients']['unmanaged']['unmanaged-client-fd'] = {
  'Address' => 'unmanaged-client',
  'Password' => 'onefbofnerwob',
  'Catalog' => 'MyCatalog',
  'FDPort' => '9102'

autochanger (if using tape storage)

# Example/Test Tape Autochanger Configurations
if node['bareos']['storage']['autochanger_enabled'] == true
  default['bareos']['storage']['autochangers']['autochanger-0'] = {
    'Device' => [
    'Changer Device' => ['/dev/tape/by-id/scsi-1TANDBERGStorageLoader_SOMEAUTOCHANGER'],
    'Changer Command' => ['"/usr/lib/bareos/scripts/mtx-changer %c %o %S %a %d"']

  default['bareos']['storage']['autochangers']['autochanger-1'] = {
    'Device' => [
    'Changer Device' => ['/dev/tape/by-id/scsi-1TANDBERGStorageLoader_SOMEAUTOCHANGER'],
    'Changer Command' => ['"/usr/lib/bareos/scripts/mtx-changer %c %o %S %a %d"']

  default['bareos']['storage']['devices']['tapedrive-0'] = {
    'DeviceType' => 'tape',
    'DriveIndex' => '0',
    'ArchiveDevice' => 'dev/nst0',
    'MediaType' => 'lto',
    'Autochanger' => 'no',
    'AutomaticMount' => 'no',
    'MaximumFileSize' => '10GB'

  default['bareos']['storage']['devices']['tapedrive-1'] = {
    'DeviceType' => 'tape',
    'DriveIndex' => '0',
    'ArchiveDevice' => 'dev/nst0',
    'MediaType' => 'lto',
    'Autochanger' => 'no',
    'AutomaticMount' => 'no',
    'MaximumFileSize' => '10GB'


default['bareos']['director']['conf']['help']['Example Block'] = '# You can put extra configs here.'


# Default Filesets
default['bareos']['clients']['filesets']['default'] = {
  'options' => {
    'signature' => 'MD5'
  'include' => {
    'File' => ['/', '/home'],
    'Exclude Dir Containing' => ['.bareos_ignore']
  'exclude' => {
    'File' => [

job_definitions (jobdefs)

# Default Job Definitions
default['bareos']['clients']['job_definitions']['default-def'] = {
  'Level' => 'Incremental',
  'Fileset' => 'default-fileset',
  'Schedule' => 'monthly',
  'Storage' => 'default-file-storage',
  'Messages' => 'Standard',
  'Pool' => 'default-file-pool',
  'Priority' => '10',
  'Write Bootstrap' => '"/var/lib/bareos/%c.bsr"',
  'SpoolData' => 'no'

default['bareos']['clients']['job_definitions']['default-catalog-def'] = {
  'Level' => 'Full',
  'Fileset' => 'Catalog',
  'Schedule' => 'WeeklyCycleAfterBackup',
  'Storage' => 'default-file-storage',
  'Messages' => 'Standard',
  'Pool' => 'default-file-pool',
  'Allow Duplicate Jobs' => 'no'

default['bareos']['clients']['job_definitions']['default-restore-def'] = {
  'Fileset' => 'default-fileset',
  'Storage' => 'default-file-storage',
  'Messages' => 'Standard',
  'Pool' => 'default-file-pool',
  'Priority' => '7',
  'Where' => '/tmp/bareos-restores'


# Director Jobs, basically the same as client but meant to be more admin related:
default['bareos']['director']['jobs'] = nil
# Example Client Jobs:
default['bareos']['clients']['jobs']["#{node.default['bareos']['clients']['name']}-job"] = {
  'Client' => "#{node['bareos']['clients']['name']}-fd",
  'Type' => 'Backup',
  'JobDefs' => 'default-def'

default['bareos']['clients']['jobs']["#{node.default['bareos']['clients']['name']}-restore-job"] = {
  'Client' => "#{node['bareos']['clients']['name']}-fd",
  'Type' => 'Restore',
  'JobDefs' => 'default-restore-def'


# Default Pools
default['bareos']['clients']['pools']['default-file-pool'] = {
  'Pool Type' => 'Backup',
  'Recycle' => 'yes',
  'Volume Retention' => '30 days',
  'Maximum Volume Bytes' => '10G',
  'Maximum Volumes' => '25',
  'LabelFormat' => 'FileVolume-'


# Default Schedules
default['bareos']['clients']['schedules']['monthly'] = {
  'Description' => [
    'Default Monthly Schedule'
  'Run' => [
    'Full 1st sun at 23:05',
    'Differential 2nd-5th sun at 23:05',
    'Incremental mon-sat at 23:05'
  'Enabled' => [


default['bareos']['storage']['conf']['help']['Example Block'] = '# You can put extra configs here.'


# Default Storages
default['bareos']['clients']['storages']['default-file-storage'] = {
  'Address' => node['bareos']['storage']['name'], # N.B. Use a fully qualified name here
  'Device' => 'FileStorage',
  'Media Type' => 'File'


  1. Fork the repository on Github
  2. Create a named feature branch (like add_component_x)
  3. Write your change
  4. Write kitchen and/or chefspec (rspec) tests for your change (if possible)
  5. Run the tests, ensuring they all pass or travis-ci will do it for you
  6. Submit a Pull Request using GitHub

License and Authors


Copyright (C) 2016 Leonard TAVAE

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.


  • Leonard TAVAE
  • Ian Smith
  • Gerhard Sulzberger

Dependent cookbooks

apt >= 2.0
openssl >= 4.0
postgresql ~> 4.0
yum-epel >= 0.6

Contingent cookbooks

There are no cookbooks that are contingent upon this one.


Chef-Bareos Cookbook


Ian Smith

  • Decided to change who owned all of the graphite_plugin bits
    1. Bareos plugin still seems to have some debugging code that will not only PRINT your password to the command line if done by hand, but will also EMAIL your main director password to whatever account owns, say, a cronjob (i.e. root). Seems like a security flaw? I submitted bugfix bareos/bareos-contrib/#14 to address this issue, waiting for merge. If you need an immediate fixed source, use my GitBytes/bareos-contrib fork. Sorry about that..
    2. Pretty much wherever root was, I changed to bareos in the plugin recipe.
  • Cleanup README and CHANGELOG raw syntax for GitHub and Supermarket rendering
  • Add new chefspec/rspec unit tests, cleanup existing tests
    1. Removed unused .rspec config file
    2. Removed repo_spec test, never quite worked right
    3. Added :documentation and color output to chefspec/rspec testing
    4. Added graphite_plugin_spec test
    5. Condensed and cleaned up default_spec test, tests both the repo and client recipes on top of the implied default recipe
    6. Added ability to easily run tests against a variety of preset supported platforms via spec/unit/support/supported_platforms definition file (see default_spec test for example usage)
  • Add new/optimize serverspec integration tests
    1. Condense tests for overall functionality of Bareos
    2. New graphite plugin testing: plugin, config, cronjob
  • Bump patch version to 3.0.3 (tag v3.0.3)


Ian Smith

  • Complete re-work of cookbook, which includes the rework bits from version 2.0
  • Adding various features including:
    • Templates populated from hash tables
    • Up to date README
    • Graphite plugin deployment recipe
    • Migrate to postgresql cookbook version 4+
    • Better testing (rspec), testing against current ruby, need some more rspec tests but no time
    • Various other updates and enhancements, see README for details
    • Supermarket Release...finally
  • NOTE This release adds functionality that is not backwards compatible. Version lock until you have time to test the migration to version 3.0+


Ian Smith

  • Near complete refactoring of how the cookbook works
    • Adding various ways to add configs based on hashes. Examples in attributes/default.rb
  • Updating README for usage details
  • If you are not prepared to use this cookbook version, please lock cookbook version to < 2.0.0
  • TODO: Refactor main bareos-dir/sd/fd configs to be fully based on hashes like other configs
    • Remaining attributes support primary bareos-dir/sd/fd configs mostly, used elsewhere but not much


Ian Smith

  • Updating and validating Kitchen testing with new methods
  • Adding ability to use custom Storage Daemon Configs via wrapper recipe
  • Fixed a race condition that was likely to come up both in testing and production
    • Was missing client config on fresh install so restart of dir would fail
  • Limiting cookbook support for debian to ~>7.0 until we can test on 8+
  • Refined storage recipe to correctly create client configs based on BOTH role search and solo instances, may need a bit more tuning but should work in most cases
  • Creating basic Full, Inc, and Diff pools even if not used, just as a place holder (default)
  • Minor fixes
  • Larger version bump for version clarity
  • Updated Docs
  • Adding support for Fedora and RHEL 6/7
  • Reworked the available repos to some better logic


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 separate 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
  • 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


Ian Smith

  • Updating README
  • Updating CHANGELOG
  • Updating metadata file


Leonard TAVAE

  • The License has changed (Apache 2.0)
  • The cookbook now passed foodcritic, rubocop and tailor with success
  • Some minor bugs fix

Ian Smith

  • Updating Cookbook to use ChefDK >0.6.0
  • Updating Docs
  • Updating Postgresql Logic/Commands
  • Updating a couple of template bits for the director
    • Adding new attributes, working on more for future implementation
  • Updating Kitchen suites/platforms/provisioner
    • Adding some test roles for tests
  • Updating chefspec/rspec/serverspec testing
  • Updating TravisCI testing parameters so they are more standard


Leonard TAVAE

  • Major release


Leonard TAVAE

  • Initial release of bareos - - -

Collaborator Number Metric

3.0.3 failed this metric

Failure: Cookbook has 1 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric

3.0.3 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Foodcritic Metric

3.0.3 failed this metric

FC066: Ensure chef_version is set in metadata: chef-bareos/metadata.rb:1
FC069: Ensure standardized license defined in metadata: chef-bareos/metadata.rb:1
FC075: Cookbook uses to save partial node data to the chef-server mid-run: chef-bareos/recipes/client.rb:24
FC075: Cookbook uses to save partial node data to the chef-server mid-run: chef-bareos/recipes/server.rb:27
FC075: Cookbook uses to save partial node data to the chef-server mid-run: chef-bareos/recipes/storage.rb:24
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

No Binaries Metric

3.0.3 passed this metric

Testing File Metric

3.0.3 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Version Tag Metric

3.0.3 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must include a tag that matches this cookbook version number