mila.bareos
Bareos
This guide describes how to set up a BareOS server and its clients.
Variables
Server
Note: You can find more options in defaults/main.yml
bareos_install_server
- Set totrue
to install server packages (default isfalse
). This also installs PostgreSQL.bareos_setup_db
- Set totrue
to check if the PostgreSQL databasebareos
exists, and create it if it doesn’t (default isfalse
).bareos_setup_db_sensu
- Set totrue
to create asensu
database user for monitoring (default isfalse
).bareos_sensu_postgres_pass
- Password for thesensu
user in PostgreSQL.bareos_email
- Email address for notifications and Catalog bootstrap.bareos_dir_ip_eth
- IP address for the BareOS Director.bareos_dir_max_concurrent_jobs
- Maximum number of concurrent jobs at the Director level (default is 50, optional).bareos_director
- Use this to override the backup Director IP address in the client's/etc/hosts
.bareos_repo
- Default is the BareOS Community Repository; you can switch to the BareOS Subscription Repository.bareos_sd_max_concurrent_jobs
- Maximum number of concurrent jobs at the Storage Daemon level (default is 50, optional).
Example for specifying the Director:
bareos_director:
ip: 10.0.0.1
name: backup
bareos_clients
- List of client configurations, in this format:
bareos_clients:
- name: some-hostname
ansible_delegate_hostname: some-hostname
address: 10.1.1.1
password: MySuperSecretPassword
enable_backup_job: true
state: present # optional
autostart: true # optional
director_ip: 10.0.0.1 # optional
director_name: backup # optional
max_job_bandwidth: 1 mb/s # optional
max_concurrent_jobs: 42 # optional, defaults to '20'
bareos_filesets
: List of filesets with this format:
bareos_filesets:
- name: FilesetFoo
description: "Backup Foo"
include_files:
- /home/foo
exclude_files:
- /home/foo/bar
[!WARNING]
bareos_filesets[*].include_file
has been replaced withbareos_filesets[*].include_files
, which allows a list of file paths to include.[!WARNING]
bareos_filesets[*].exclude_file
has been replaced withbareos_filesets[*].exclude_files
for excluding a list of file paths.
bareos_pools
: List of storage pools formatted as follows:
bareos_pools:
- name: FullFoo
retention: "365 days" # optional
max_vol_bytes: 50G # optional
max_vol: 1000 # optional
next_pool: FullFooOffsite # optional
label: "FullFoo-"
storage: FileFoo # optional if defined at the JobDefs level
- name: IncrementalFoo
retention: "365 days"
max_vol_bytes: 50G
max_vol: 1000
label: "IncrementalFoo-"
storage: FileFoo # optional if defined at the JobDefs level
bareos_dir_storage
: List of storage devices in this format:
bareos_dir_storage:
- name: FileFoo
device: FileStorageFoo
bareos_dir_ip: 10.0.0.1
media_type: File2 # optional, defaults to 'File'
max_concurrent_jobs: 42 # optional, defaults to '50'
If you have multiple devices, use devices
:
bareos_dir_storage:
- name: FileFoo
devices:
- FileStorageFoo
- FileStorageBar
bareos_dir_ip: 10.0.0.1
media_type: File2 # optional, defaults to 'File'
max_concurrent_jobs: 42 # optional, defaults to '50'
bareos_devices
: List of devices in this format:
bareos_devices:
- name: FileStorageFoo
archive_device: /backup
block_device: /dev/mapper/backup # optional
fstype: 'ext4' # default
mode: '0750' # default
opts: '' # optional, for ansible.posix.mount
state: 'mounted' # default
media_type: File2 # optional, defaults to 'File'
max_concurrent_jobs: 42 # optional, defaults to '50'
[!WARNING]
bareos_devices[*].arch_device
is replaced bybareos_devices[*].archive_device
.
bareos_schedules
: List of schedules formatted as follows:
bareos_schedules:
- name: ScheduleFoo
full: "Full on 1 at 02:23"
incr: "Incremental daily at 02:25"
bareos_jobdefs
: List of job definitions formatted like this:
bareos_jobdefs:
- name: JobDefFoo
level: Incremental
client: foo-fd
fileset: FilesetFoo
schedule: ScheduleFoo
storage: FileFoo # optional
pool: IncrementalFoo
full_pool: FullFoo
incr_pool: IncrementalFoo
type: JOB_TYPE # optional, defaults to 'Backup'
max_concurrent_jobs: 42 # optional, defaults to '50'
bareos_jobs
: List of jobs formatted like this:
bareos_jobs:
- name: JobFoo
jobdef: JobDefFoo
client: foo-fd
NOTES:
ansible_delegate_hostname
must match theinventory_hostname
in the Ansible inventory list. Some tasks will be delegated from the backup server to this client.enable_backup_job
- This creates a backup job namedDefaultJobLinux
.state
- Set toabsent
to remove the client from server configuration (default ispresent
).autostart
- Schedule the first backup immediately (default istrue
).director_ip
- [Optional] Same asbareos_director
, just set in a different location.director_name
- [Optional] Same asbareos_director
, just set in a different location.
Client
bareos_install_client
- Set totrue
to install client packages (default isfalse
).
Example Playbook
---
- hosts: bareos-client
become: true
roles:
- { name: bareos, tags: bareos }
- hosts: bareos-server
become: true
roles:
- { name: bareos, tags: bareos }
License
GNU GPL
Author Information
Jan Michalek, also known as VeselaHouba