{"id":15018275,"url":"https://github.com/robertdebock/ansible-role-bareos_dir","last_synced_at":"2025-04-15T03:31:02.681Z","repository":{"id":189921287,"uuid":"681524760","full_name":"robertdebock/ansible-role-bareos_dir","owner":"robertdebock","description":"Install and configure [Bareos](https://www.bareos.com/) Director.","archived":false,"fork":false,"pushed_at":"2025-03-06T11:43:45.000Z","size":223,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T15:15:42.319Z","etag":null,"topics":["ansible","bareos","infrastructure","linux","molecule","playbook","storage","system","tools","tox"],"latest_commit_sha":null,"homepage":"https://robertdebock.nl/","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robertdebock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"robertdebock"}},"created_at":"2023-08-22T07:46:21.000Z","updated_at":"2025-03-06T11:43:29.000Z","dependencies_parsed_at":"2023-08-22T12:17:10.948Z","dependency_job_id":"879e791a-29e8-461c-83b1-e2a763f245ec","html_url":"https://github.com/robertdebock/ansible-role-bareos_dir","commit_stats":{"total_commits":138,"total_committers":1,"mean_commits":138.0,"dds":0.0,"last_synced_commit":"ad74ab3d33183a63c459448b7e7f11db1403e062"},"previous_names":["robertdebock/ansible-role-bareos_dir"],"tags_count":48,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdebock%2Fansible-role-bareos_dir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdebock%2Fansible-role-bareos_dir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdebock%2Fansible-role-bareos_dir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdebock%2Fansible-role-bareos_dir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertdebock","download_url":"https://codeload.github.com/robertdebock/ansible-role-bareos_dir/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249001374,"owners_count":21196355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","bareos","infrastructure","linux","molecule","playbook","storage","system","tools","tox"],"created_at":"2024-09-24T19:51:46.349Z","updated_at":"2025-04-15T03:31:02.651Z","avatar_url":"https://github.com/robertdebock.png","language":"Jinja","funding_links":["https://github.com/sponsors/robertdebock"],"categories":[],"sub_categories":[],"readme":"# [Ansible role bareos_dir](#bareos_dir)\n\nInstall and configure [Bareos](https://www.bareos.com/) Director.\n\n|GitHub|GitLab|Downloads|Version|\n|------|------|---------|-------|\n|[![github](https://github.com/robertdebock/ansible-role-bareos_dir/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-bareos_dir/actions)|[![gitlab](https://gitlab.com/robertdebock-iac/ansible-role-bareos_dir/badges/master/pipeline.svg)](https://gitlab.com/robertdebock-iac/ansible-role-bareos_dir)|[![downloads](https://img.shields.io/ansible/role/d/robertdebock/bareos_dir)](https://galaxy.ansible.com/robertdebock/bareos_dir)|[![Version](https://img.shields.io/github/release/robertdebock/ansible-role-bareos_dir.svg)](https://github.com/robertdebock/ansible-role-bareos_dir/releases/)|\n\n## [Example Playbook](#example-playbook)\n\nThis example is taken from [`molecule/default/converge.yml`](https://github.com/robertdebock/ansible-role-bareos_dir/blob/master/molecule/default/converge.yml) and is tested on each push, pull request and release.\n\n```yaml\n---\n- name: Converge\n  hosts: all\n  become: true\n  gather_facts: true\n\n  roles:\n    - role: ansible-role-bareos_dir\n      bareos_dir_backup_configurations: true\n      bareos_dir_install_debug_packages: true\n      bareos_dir_catalogs:\n        - name: MyCatalog\n          dbname: bareos\n          dbuser: bareos\n          dbpassword: \"\"\n      bareos_dir_consoles:\n        - name: bareos-mon\n          description: \"Restricted console used by tray-monitor to get the status of the director.\"\n          password: \"MySecretPassword\"\n          commandacl:\n            - status\n            - .status\n          jobacl:\n            - \"*all\"\n      bareos_dir_clients:\n        - name: bareos-fd\n          address: 127.0.0.1\n          password: \"MySecretPassword\"\n          maximum_concurrent_jobs: 3\n          heartbeat_interval: 60\n        - name: \"disabled-client\"\n          enabled: false\n      bareos_dir_filesets:\n        - name: LinuxAll\n          description: \"Backup all regular filesystems, determined by filesystem type.\"\n          include:\n            files:\n              - /\n            exclude_dirs_containing: nobackup\n            options:\n              signature: MD5\n              one_fs: false\n              fs_types:\n                - btrfs\n                - ext2\n                - ext3\n                - ext4\n                - reiserfs\n                - jfs\n                - vfat\n                - xfs\n                - zfs\n              compression: GZIP\n          exclude:\n            files:\n              - /var/lib/bareos\n              - /var/lib/bareos/storage\n              - /proc\n              - /tmp\n              - /var/tmp\n              - /.journal\n              - /.fsck\n        - name: disabled-fileset\n          enabled: false\n      bareos_dir_jobdefs:\n        - name: DefaultJob-1\n          type: Backup\n          level: Incremental\n          fileset: SelfTest\n          schedule: WeeklyCycle\n          storage: File-1\n          messages: Standard\n          pool: Full\n          priority: 10\n          write_bootstrap: \"/var/lib/bareos/%c.bsr\"\n          full_backup_pool: Full\n          differential_backup_pool: Differential\n          incremental_backup_pool: Incremental\n        - name: \"disabled-jobdef\"\n          enabled: false\n      bareos_dir_jobs:\n        - name: my_job\n          description: \"My backup job\"\n          pool: Full\n          type: Backup\n          client: bareos-fd\n          fileset: LinuxAll\n          storage: File-1\n          messages: Standard\n        - name: disabled_job\n          enabled: false\n        - name: BackupCatalog\n          description: \"Backup the catalog database (after the nightly save)\"\n          jobdefs: DefaultJob\n          level: Full\n          fileset: Catalog\n          client: bareos-fd\n          schedule: WeeklyCycleAfterBackup\n          runbeforejob: \"/usr/lib/bareos/scripts/make_catalog_backup MyCatalog\"\n          runafterjob: \"/usr/lib/bareos/scripts/delete_catalog_backup MyCatalog\"\n          write_bootstrap: '|/usr/bin/bsmtp -h localhost -f \\\"\\(Bareos\\) \\\" -s \\\"Bootstrap for Job %j\\\" root'\n          priority: 11\n          maximum_concurrent_jobs: 2\n      bareos_dir_messages:\n        - name: \"Standard\"\n          description: \"Send relevant messages to the Director.\"\n          append:\n            - file: \"/var/log/bareos/bareos.log\"\n              messages:\n                - all\n                - \"!skipped\"\n                - \"!terminate\"\n          catalog:\n            - all\n            - \"!skipped\"\n            - \"!saved\"\n            - \"!audit\"\n          console:\n            - all\n            - \"!skipped\"\n            - \"!saved\"\n        - name: \"disabled-message\"\n          enabled: false\n        - name: Daemon\n          description: \"Message delivery for daemon messages (no job).\"\n          mailcommand: '/usr/bin/bsmtp -h localhost -f \\\"\\(Bareos\\) \\\u003c%r\\\u003e\\\" -s \\\"Bareos daemon message\\\" %r'\n          mail:\n            - to: root\n              messages:\n                - all\n                - \"!skipped\"\n                - \"!audit\"\n          console:\n            - all\n            - \"!skipped\"\n            - \"!saved\"\n            - \"!audit\"\n          append:\n            - file: \"/var/log/bareos/bareos.log\"\n              messages:\n                - all\n                - \"!skipped\"\n                - \"!audit\"\n            - file: \"/var/log/bareos/bareos-audit.log\"\n              messages:\n                - audit\n        - name: RestoreFiles\n          description: \"Standard Restore template. Only one such job is needed for all standard Jobs/Clients/Storage ...\"\n          type: Restore\n          client: bareos-fd\n          fileset: LinuxAll\n          storage: File-1\n          pool: Incremental\n          messages: Standard\n          where: \"/tmp/bareos-restores\"\n      bareos_dir_pools:\n        - name: Full\n          pool_type: Backup\n          recycle: true\n          autoprune: true\n          volume_retention: 365 days\n          maximum_volume_bytes: 50G\n          maximum_volumes: 100\n          label_format: \"Full-\"\n        - name: \"disabled-pool\"\n          enabled: false\n      bareos_dir_profiles:\n        - name: webui-admin\n          jobacl:\n            - \"*all*\"\n          clientacl:\n            - \"*all*\"\n          storageacl:\n            - \"*all*\"\n          scheduleacl:\n            - \"*all*\"\n          poolacl:\n            - \"*all*\"\n          commandacl:\n            - \"!.bvfs_clear_cache\"\n            - \"!.exit\"\n            - \"!.sql\"\n            - \"!configure\"\n            - \"!create\"\n            - \"!delete\"\n            - \"!purge\"\n            - \"!prune\"\n            - \"!sqlquery\"\n            - \"!umount\"\n            - \"!unmount\"\n            - \"*all*\"\n          filesetacl:\n            - \"*all*\"\n          catalogacl:\n            - \"*all*\"\n          whereacl:\n            - \"*all*\"\n          pluginoptionsacl:\n            - \"*all*\"\n        - name: \"disabled-message\"\n          enabled: false\n      bareos_dir_schedules:\n        - name: WeeklyCycle\n          run:\n            - Full 1st sat at 21:00\n            - Differential 2nd-5th sat at 21:00\n            - Incremental mon-fri at 21:00\n        - name: WeeklyCycleAfterBackup\n          description: This schedule does the catalog. It starts after the WeeklyCycle.\n          run:\n            - Full mon-fri at 21:10\n        - name: \"disabled-schedule\"\n          enabled: false\n      bareos_dir_storages:\n        - name: File-1\n          address: dir-1\n          password: \"MySecretPassword\"\n          device: FileStorage\n          media_type: File\n          tls_enable: true\n          tls_verify_peer: false\n          maximum_concurrent_jobs: 3\n        - name: \"disabled-storage\"\n          enabled: false\n```\n\nThe machine needs to be prepared. In CI this is done using [`molecule/default/prepare.yml`](https://github.com/robertdebock/ansible-role-bareos_dir/blob/master/molecule/default/prepare.yml):\n\n```yaml\n---\n- name: Prepare\n  hosts: all\n  become: true\n  gather_facts: false\n\n  roles:\n    - role: robertdebock.bootstrap\n    # The roles buildtools, python_pip and postgres are required.\n    # bareos-dir needs to connect to a database.\n    - role: robertdebock.buildtools\n    - role: robertdebock.postgres\n    # The roles core_dependencies and postfix are  required for the `bareos_role`: \"dir\".\n    # bareos-dir needs to send emails.\n    - role: robertdebock.core_dependencies\n    - role: robertdebock.postfix\n      postfix_myhostname: \"smtp.example.com\"\n      postfix_mydomain: \"example.com\"\n      postfix_myorigin: \"example.com\"\n    - role: robertdebock.bareos_repository\n      bareos_repository_enable_tracebacks: true\n```\n\nAlso see a [full explanation and example](https://robertdebock.nl/how-to-use-these-roles.html) on how to use these roles.\n\n## [Role Variables](#role-variables)\n\nThe default values for the variables are set in [`defaults/main.yml`](https://github.com/robertdebock/ansible-role-bareos_dir/blob/master/defaults/main.yml):\n\n```yaml\n---\n# defaults file for bareos_dir\n\n# The director has these configuration parameters.\n\n# Backup the configuration files.\nbareos_dir_backup_configurations: false\n\n# Install debug packages. This requires the debug repositories to be enabled.\nbareos_dir_install_debug_packages: false\n\n# The hostname of the Director.\nbareos_dir_hostname: \"{{ inventory_hostname }}\"\n\n# The password for the Director.\nbareos_dir_password: \"secretpassword\"\n\n# The query file.\nbareos_dir_queryfile: \"/usr/lib/bareos/scripts/query.sql\"\n\n# The maximum number of concurrent jobs.\nbareos_dir_max_concurrent_jobs: 100\n\n# The messages configuration to use.\nbareos_dir_message: Daemon\n\n# Enable TLS.\nbareos_dir_tls_enable: true\n\n# Verify the peer.\nbareos_dir_tls_verify_peer: false\n\n# A list of catalogs to configure.\nbareos_dir_catalogs: []\n\n# A list of consoles to configure.\nbareos_dir_consoles: []\n\n# A list of counters to configure.\nbareos_dir_counters: []\n\n# A list of clients to configure.\nbareos_dir_clients: []\n\n# A list of filesets to configure.\nbareos_dir_filesets: []\n\n# A list of jobdefs to configure\nbareos_dir_jobdefs: []\n\n# A list of jobs to configure.\nbareos_dir_jobs: []\n\n# A list of messages to configure.\nbareos_dir_messages: []\n\n# A list of pools to configure.\nbareos_dir_pools: []\n\n# A list of profiles to configure.\nbareos_dir_profiles: []\n\n# A list of schedules to configure.\nbareos_dir_schedules: []\n\n# A list of storages to configure.\nbareos_dir_storages: []\n```\n\n## [Requirements](#requirements)\n\n- pip packages listed in [requirements.txt](https://github.com/robertdebock/ansible-role-bareos_dir/blob/master/requirements.txt).\n\n## [State of used roles](#state-of-used-roles)\n\nThe following roles are used to prepare a system. You can prepare your system in another way.\n\n| Requirement | GitHub | GitLab |\n|-------------|--------|--------|\n|[robertdebock.bootstrap](https://galaxy.ansible.com/robertdebock/bootstrap)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-bootstrap/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-bootstrap/actions)|[![Build Status GitLab](https://gitlab.com/robertdebock-iac/ansible-role-bootstrap/badges/master/pipeline.svg)](https://gitlab.com/robertdebock-iac/ansible-role-bootstrap)|\n|[robertdebock.bareos_repository](https://galaxy.ansible.com/robertdebock/bareos_repository)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-bareos_repository/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-bareos_repository/actions)|[![Build Status GitLab](https://gitlab.com/robertdebock-iac/ansible-role-bareos_repository/badges/master/pipeline.svg)](https://gitlab.com/robertdebock-iac/ansible-role-bareos_repository)|\n|[robertdebock.buildtools](https://galaxy.ansible.com/robertdebock/buildtools)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-buildtools/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-buildtools/actions)|[![Build Status GitLab](https://gitlab.com/robertdebock-iac/ansible-role-buildtools/badges/master/pipeline.svg)](https://gitlab.com/robertdebock-iac/ansible-role-buildtools)|\n|[robertdebock.python_pip](https://galaxy.ansible.com/robertdebock/python_pip)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-python_pip/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-python_pip/actions)|[![Build Status GitLab](https://gitlab.com/robertdebock-iac/ansible-role-python_pip/badges/master/pipeline.svg)](https://gitlab.com/robertdebock-iac/ansible-role-python_pip)|\n|[robertdebock.postgres](https://galaxy.ansible.com/robertdebock/postgres)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-postgres/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-postgres/actions)|[![Build Status GitLab](https://gitlab.com/robertdebock-iac/ansible-role-postgres/badges/master/pipeline.svg)](https://gitlab.com/robertdebock-iac/ansible-role-postgres)|\n|[robertdebock.core_dependencies](https://galaxy.ansible.com/robertdebock/core_dependencies)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-core_dependencies/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-core_dependencies/actions)|[![Build Status GitLab](https://gitlab.com/robertdebock-iac/ansible-role-core_dependencies/badges/master/pipeline.svg)](https://gitlab.com/robertdebock-iac/ansible-role-core_dependencies)|\n|[robertdebock.postfix](https://galaxy.ansible.com/robertdebock/postfix)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-postfix/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-postfix/actions)|[![Build Status GitLab](https://gitlab.com/robertdebock-iac/ansible-role-postfix/badges/master/pipeline.svg)](https://gitlab.com/robertdebock-iac/ansible-role-postfix)|\n\n## [Context](#context)\n\nThis role is a part of many compatible roles. Have a look at [the documentation of these roles](https://robertdebock.nl/) for further information.\n\nHere is an overview of related roles:\n![dependencies](https://raw.githubusercontent.com/robertdebock/ansible-role-bareos_dir/png/requirements.png \"Dependencies\")\n\n## [Compatibility](#compatibility)\n\nThis role has been tested on these [container images](https://hub.docker.com/u/robertdebock):\n\n|container|tags|\n|---------|----|\n|[Debian](https://hub.docker.com/r/robertdebock/debian)|bookworm, bullseye|\n|[EL](https://hub.docker.com/r/robertdebock/enterpriselinux)|9|\n|[Fedora](https://hub.docker.com/r/robertdebock/fedora)|40|\n|[Ubuntu](https://hub.docker.com/r/robertdebock/ubuntu)|jammy|\n\nThe minimum version of Ansible required is 2.12, tests have been done to:\n\n- The previous version.\n- The current version.\n- The development version.\n\nIf you find issues, please register them in [GitHub](https://github.com/robertdebock/ansible-role-bareos_dir/issues).\n\n## [License](#license)\n\n[Apache-2.0](https://github.com/robertdebock/ansible-role-bareos_dir/blob/master/LICENSE).\n\n## [Author Information](#author-information)\n\n[robertdebock](https://robertdebock.nl/)\n\nPlease consider [sponsoring me](https://github.com/sponsors/robertdebock).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertdebock%2Fansible-role-bareos_dir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertdebock%2Fansible-role-bareos_dir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertdebock%2Fansible-role-bareos_dir/lists"}