Role to setup BareOS server and clients.
Note: More options can be seen in defaults/main.yml
bareos_install_server- Install packages valid for server (false). Note that this also installs postgresql!bareos_setup_db- Check if postgresql DBbareosexists. If not, create and fill with data (false)bareos_setup_db_sensu- CreatessensuDB user for monitoring (false)bareos_sensu_postgres_pass- Set pass for user sensu to postgresqlbareos_email- Email address used for messages (Daemon, Standard) and Catalog bootstrapbareos_dir_ip_eth- Director ethernet IP addressbareos_dir_max_concurrent_jobs- [Optional] Director-level maximum concurrent jobs, defaults to 50bareos_director- If you need to override backup director IP address on your client's /etc/hostsbareos_repo- Defaults to Bareos Community Repository. Can be changed to use the Bareos Subscription Repositorybareos_sd_max_concurrent_jobs- [Optional] SD-level maximum concurrent jobs, defaults to 50bareos_sd_file_device_concurrent_read- [Optional] SD-level specifies the maximum number of Jobs with the current Storage resource that can read concurrentlybareos_catalog_backup_script- You need to set it to/usr/lib/bareos/scripts/make_catalog_backupif using Bareos >=23
bareos_director:
ip: 10.0.0.1
name: backup
bareos_clients- List of clients in following 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 in following format:
bareos_filesets:
- name: FilesetFoo
description: "Backup Foo"
include_files:
- /home/foo
exclude_files:
- /home/foo/bar
Warning
The bareos_filesets[*].include_file is deprecated and replaced by
bareos_filesets[*].include_files that allows to define a list of File path
to include.
Warning
The bareos_filesets[*].exclude_file is deprecated and replaced by
bareos_filesets[*].exclude_files to reflect the ability to exclude a list
of File path.
bareos_pools: List of pools in following format:
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 storages in following format:
bareos_dir_storage:
- name: FileFoo
device: FileStorageFoo
bareos_sd_ip: 10.0.0.1
media_type: File2 # optional, defaults to 'File'
max_concurrent_jobs: 42 # optional, defaults to '50'
max_concurrent_read_jobs: 5 # optional
device can also become devices if you have multiple devices :
bareos_dir_storage:
- name: FileFoo
devices:
- FileStorageFoo
- FileStorageBar
bareos_sd_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 following format:
bareos_devices:
- name: FileStorageFoo
archive_device: /backup
block_device: /dev/mapper/backup # optional
fstype: 'ext4' # default
mode: '0750' # default
mkfs_opts: '' # optional, options for mkfs
mount_opts: '' # optional, for ansible.posix.mount
state: 'mounted' # default, for ansible.posix.mount
count: 5 # optional, number of multiplied devices
media_type: File2 # optional, defaults to 'File'
max_concurrent_jobs: 42 # optional, defaults to '50'
Warning
The bareos_devices[*].arch_device is deprecated and replaced by
bareos_devices[*].archive_device.
Warning
The bareos_devices[*].opts is deprecated and replaced by
bareos_devices[*].mount_opts.
bareos_schedules: List of schedules in following format:
bareos_schedules:
- name: ScheduleFoo
full: "Full on 1 at 02:23"
incr: "Incremental daily at 02:25"
bareos_jobdefs: List of jobdefs in following format:
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'
allow_mixed_priority: 'yes' # optional
client_run_before_job: "/etc/init.d/grafana-server stop" # optional
client_run_after_job: "/etc/init.d/grafana-server start" # optional
bareos_jobs: List of jobs in following format:
bareos_jobs:
- name: JobFoo
jobdef: JobDefFoo
client: foo-fd
NOTES:
ansible_delegate_hostnamemust matchinventory_hostnamein ansible inventory list. Some tasks will be delegated from backup server to this clientenable_backup_job- Will create backup jobDefaultJobLinuxstate- When set toabsent, client will be removed from server config (default:present)autostart- Schedule first backup right away (default:false)director_ip- [Optional] Same asbareos_director, just different place to setupdirector_name- [Optional] Same asbareos_director, just different place to setup
bareos_install_client- Install packages for client (false)
---
- hosts: bareos-client
become: true
roles:
- { name: bareos, tags: bareos }
- hosts: bareos-server
become: true
roles:
- { name: bareos, tags: bareos }
GNU GPL
Jan Michalek a.k.a. VeselaHouba