diff --git a/README.md b/README.md index bcadd17..25d0618 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ $ git clone https://github.com/borgbase/ansible-role-borgbackup.git roles/ansibl - `borg_encryption_passphrase`: Password to use for repokey or keyfile. Empty if repo is unencrypted. - `borg_exclude_from`: Read exclude patterns from one or more separate named files, one pattern per line. - `borg_exclude_patterns`: Paths or patterns to exclude from backup. See [official documentation](https://borgbackup.readthedocs.io/en/stable/usage/help.html#borg-help-patterns) for more. -- `borg_install_method`: By default `pip` is used to install borgmatic. To install via your distributions package manager set this to `package` and (if needed) overwrite the `borg_distro_packages` variable to contain your distributions package names required to install borgmatic. Note that many distributions ship outdated versions of borgbackup and borgmatic; use at your own risk. +- `borg_install_method`: By default `pip` is used to install borgmatic. To install via your distributions package manager set this to `package` and (if needed) overwrite the `borg_distro_packages` variable to contain your distributions package names required to install borgmatic. Note that many distributions ship outdated versions of borgbackup and borgmatic; use at your own risk. `none` completely disables installation management. - `borg_require_epel`: When using `borg_install_method: package` on RHEL-based distributions, the EPEL repo is required. To disable the check (e.g. when using a custom mirror instead of the `epel-release` package), set this to `false`. Defaults to `{{ ansible_os_family == 'RedHat' and ansible_distribution != 'Fedora' }}` (i.e. `true` on Enterprise Linux-based distros). - `borg_lock_wait_time`: Config maximum seconds to wait for acquiring a repository/cache lock. Defaults to 5 seconds. - `borg_one_file_system`: Don't cross file-system boundaries. Defaults to `true` @@ -122,6 +122,7 @@ $ git clone https://github.com/borgbase/ansible-role-borgbackup.git roles/ansibl - `borgmatic_commands`: Invoke script before/after actions. See [How to add preparation and cleanup steps to backups](https://torsion.org/borgmatic/docs/how-to/add-preparation-and-cleanup-steps-to-backups/) for more. - `borgmatic_timer`: If the variable is set, a timer is installed. A choice must be made between `cron` and `systemd`. - `borgmatic_relocated_repo_access_is_ok`: Bypass Borg error about a repository that has been moved. Defaults to `false` +- `borgmatic_unknown_unencrypted_repo_access_is_ok`: Bypass Borg error about a previously unknown unencrypted repository. Defaults to `false` - `borgmatic_store_atime`: Store atime into archive. Defaults to `true` - `borgmatic_store_ctime`: Store ctime into archive. Defaults to `true` - `borgmatic_version`: Force a specific borgmatic version to be installed diff --git a/defaults/main.yml b/defaults/main.yml index 95db049..abef846 100755 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -53,6 +53,7 @@ borgmatic_check_last: 3 borgmatic_store_atime: true borgmatic_store_ctime: true borgmatic_relocated_repo_access_is_ok: false +borgmatic_unknown_unencrypted_repo_access_is_ok: false borgmatic_version: ">=1.7.11" borg_venv_path: "/opt/borgmatic" diff --git a/meta/argument_specs.yml b/meta/argument_specs.yml index cf4ca8a..55e224f 100644 --- a/meta/argument_specs.yml +++ b/meta/argument_specs.yml @@ -36,6 +36,7 @@ argument_specs: overwrite the borg_distro_packages variable to contain your distributions package names required to install borgmatic. Note that many distributions ship outdated versions of borgbackup and borgmatic; use at your own risk. + Set to none to disable installation management. borgmatic_config_name: type: str required: false @@ -114,6 +115,9 @@ argument_specs: borgmatic_relocated_repo_access_is_ok: type: bool description: Bypass Borg error about a repository that has been moved. + borgmatic_unknown_unencrypted_repo_access_is_ok: + type: bool + description: Bypass Borg error about a previously unknown unencrypted repository. borg_retention_policy: type: dict description: Define the pruning policy diff --git a/tasks/01_install.yml b/tasks/01_install.yml index 83896fc..ac5357c 100644 --- a/tasks/01_install.yml +++ b/tasks/01_install.yml @@ -1,5 +1,6 @@ --- - name: Install borgbackup + when: borg_install_method != "none" block: - name: Include OS-specific variables include_vars: "{{ item }}" diff --git a/templates/config.yaml.j2 b/templates/config.yaml.j2 index 23fd8eb..e9ba1fc 100644 --- a/templates/config.yaml.j2 +++ b/templates/config.yaml.j2 @@ -18,12 +18,10 @@ one_file_system: {{ borg_one_file_system }} repositories: {% if borg_repository is iterable and (borg_repository is not string and borg_repository is not mapping) %} {% for repo in borg_repository %} - - path: {{ repo }} - encryption: repokey + - path: {{ repo }} {% endfor %} {% elif borg_repository is defined and borg_repository is string %} - - path: {{ borg_repository }} - encryption: repokey + - path: {{ borg_repository }} {% endif %} # Store atime into archive. @@ -113,6 +111,9 @@ archive_name_format: '{hostname}-{now:%Y-%m-%d-%H%M%S}' # Bypass Borg error about a repository that has been moved. relocated_repo_access_is_ok: {{ borgmatic_relocated_repo_access_is_ok }} + # Bypass Borg error about a previously unknown unencrypted repository. + unknown_unencrypted_repo_access_is_ok: {{ borgmatic_unknown_unencrypted_repo_access_is_ok }} + # Retention policy for how many backups to keep in each category. See # https://borgbackup.readthedocs.org/en/stable/usage.html#borg-prune for details. # At least one of the "keep" options is required for pruning to work. diff --git a/vars/RedHat-10.yml b/vars/RedHat-10.yml new file mode 100644 index 0000000..9949331 --- /dev/null +++ b/vars/RedHat-10.yml @@ -0,0 +1,28 @@ +--- +borg_dep_packages: + - openssh-clients + +borg_cron_package: cronie + +borg_pip_packages: + - gcc + - gcc-c++ + - libacl + - libacl-devel + - libzstd-devel + - lz4-devel + - openssl-devel + # - python3-devel + - python3-pip + - python3-setuptools + - xxhash + - xxhash-devel + # - python3-virtualenv + # - python3-wheel + +borg_distro_packages: + - borgbackup + - borgmatic + +python_bin: python3 +pip_bin: pip3