stancel.add-job-to-bareos-director
Add Job to Bareos Director
This guide is for users of the Bareos Backup System, which is a top-quality open-source backup management tool that includes an easy-to-use Web UI for restoring backups. One of the slowest parts of using Bareos is adding new machines or files to back up.
This role offers a quick and simple method to add new computers or items for backup. You should run this role on your Bareos Server, where the Bareos director and storage daemon files are located.
Bareos is based on Bacula. Although this Ansible role may work with Bacula, it has only been tested with Bareos.
Bareos can back up laptops and devices without static IPs, but this role does not currently support those setups. It assumes that the Bareos director (bareos-dir) can reach the server_fqdn
during the backup process to work with the Bareos file daemon (bareos-fd) to get the necessary files and send them to the storage daemon (bareos-sd) for long-term storage.
Requirements
You need a fully set-up Bareos Backup System on version 17.x or higher. You can check out this Ansible role for help with installing the Bareos system.
Role Variables
Hostname of the machine being backed up:
add_job_to_bareos_director_host_name: "my-important-crm-server"
Domain name or IP address of the machine to back up:
add_job_to_bareos_director_server_fqdn: "crm.example.com"
Domain name or IP of your Bareos Storage Daemon:
add_job_to_bareos_director_bareos_storage_daemon_fqdn: "To Be Filled In"
Client password matching the Bareos client program password:
add_job_to_bareos_director_client_password: "kAgt2SJTysbg5iRpcnj5XRexuEnDieGCetCXNQrYGuzNxCf"
Storage director password from your Bareos Server:
add_job_to_bareos_director_storage_director_password: "{{ lookup('env', 'BAREOS_STORAGE_PASSWORD') }}"
Backup Level Options:
- Incremental: Backs up files changed since the last backup.
- Differential: Backs up files changed since the last full backup.
- Full: Backs up all files regardless of changes.
add_job_to_bareos_director_level: Incremental
Job Priority (larger number means lower priority):
add_job_to_bareos_director_priority: 6
Backup schedule:
add_job_to_bareos_director_backup_schedule: - Run = Full sun at 02:00 - Run = Incremental mon-sat at 02:00
Storage device path:
add_job_to_bareos_director_archive_device: "/z-storage/backups/{{ add_job_to_bareos_director_host_name }}"
Files and directories to back up:
add_job_to_bareos_director_filesets_to_backup: - File = "/var/www/html" - File = "/path/to/your/directory" - File = "/backups/mysql/current"
Files and directories to exclude:
add_job_to_bareos_director_filesets_to_exclude: - File = "/var/www/html/.github" - File = "/var/www/html/.git" - File = "/var/www/html/.gitignore"
Additional variables include backup and volume retention settings.
Dependencies
No dependencies on other Ansible roles.
Example Playbook
Option 1: Using vars file
- hosts: your_bareos_server
vars_files:
- vars/main.yml
roles:
- { role: stancel.add-job-to-bareos-director }
Option 2: Specifying vars directly
- hosts: your_bareos_server
vars:
add_job_to_bareos_director_host_name: "my-important-crm-server"
add_job_to_bareos_director_server_fqdn: "crm.example.com"
add_job_to_bareos_director_client_password: "kAgt2SJTysbg5iRpcnj5XRexuEnDieGCetCXNQrYGuzNxCf"
add_job_to_bareos_director_storage_director_password: "{{ lookup('env', 'BAREOS_STORAGE_PASSWORD') }}"
add_job_to_bareos_director_level: Incremental
add_job_to_bareos_director_priority: 6
add_job_to_bareos_director_backup_schedule:
- Run = Full sun at 02:00
- Run = Incremental mon-sat at 02:00
add_job_to_bareos_director_archive_device: "/z-storage/backups/{{ host_name }}"
add_job_to_bareos_director_filesets_to_backup:
- File = "/var/www/html"
- File = "/path/to/your/directory"
- File = "/backups/mysql/current"
add_job_to_bareos_director_filesets_to_exclude:
- File = "/var/www/html/.github"
- File = "/var/www/html/.git"
- File = "/var/www/html/.gitignore"
roles:
- { role: stancel.add-job-to-bareos-director }
License
GPLv3
Author Information
The role allows for a fast and easy way to add new machines or items to be systematically backed up by Bareos.
ansible-galaxy install stancel.add-job-to-bareos-director