Skip to content

Commit c2f3a77

Browse files
committed
Merge branch 'master' into fix_systemd_root
2 parents 9a2c027 + a960af0 commit c2f3a77

6 files changed

Lines changed: 47 additions & 4 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ $ git clone https://github.com/borgbase/ansible-role-borgbackup.git roles/ansibl
8888
- `borg_encryption_passphrase`: Password to use for repokey or keyfile. Empty if repo is unencrypted.
8989
- `borg_exclude_from`: Read exclude patterns from one or more separate named files, one pattern per line.
9090
- `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.
91-
- `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.
91+
- `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.
9292
- `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).
9393
- `borg_lock_wait_time`: Config maximum seconds to wait for acquiring a repository/cache lock. Defaults to 5 seconds.
9494
- `borg_one_file_system`: Don't cross file-system boundaries. Defaults to `true`
@@ -114,6 +114,7 @@ $ git clone https://github.com/borgbase/ansible-role-borgbackup.git roles/ansibl
114114
- `borgmatic_hooks`: Hooks to monitor your backups e.g. with [Healthchecks](https://healthchecks.io/). See [official documentation](https://torsion.org/borgmatic/docs/how-to/monitor-your-backups/) for more.
115115
- `borgmatic_timer`: If the variable is set, a timer is installed. A choice must be made between `cron` and `systemd`.
116116
- `borgmatic_relocated_repo_access_is_ok`: Bypass Borg error about a repository that has been moved. Defaults to `false`
117+
- `borgmatic_unknown_unencrypted_repo_access_is_ok`: Bypass Borg error about a previously unknown unencrypted repository. Defaults to `false`
117118
- `borgmatic_store_atime`: Store atime into archive. Defaults to `true`
118119
- `borgmatic_store_ctime`: Store ctime into archive. Defaults to `true`
119120
- `borgmatic_version`: Force a specific borgmatic version to be installed

defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ borgmatic_check_last: 3
4343
borgmatic_store_atime: true
4444
borgmatic_store_ctime: true
4545
borgmatic_relocated_repo_access_is_ok: false
46+
borgmatic_unknown_unencrypted_repo_access_is_ok: false
4647
borgmatic_version: ">=1.7.11"
4748

4849
borg_venv_path: "/opt/borgmatic"

meta/argument_specs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ argument_specs:
3636
overwrite the borg_distro_packages variable to contain your distributions package names
3737
required to install borgmatic.
3838
Note that many distributions ship outdated versions of borgbackup and borgmatic; use at your own risk.
39+
Set to none to disable installation management.
3940
borgmatic_config_name:
4041
type: str
4142
required: false
@@ -114,6 +115,9 @@ argument_specs:
114115
borgmatic_relocated_repo_access_is_ok:
115116
type: bool
116117
description: Bypass Borg error about a repository that has been moved.
118+
borgmatic_unknown_unencrypted_repo_access_is_ok:
119+
type: bool
120+
description: Bypass Borg error about a previously unknown unencrypted repository.
117121
borg_retention_policy:
118122
type: dict
119123
description: Define the pruning policy

tasks/01_install.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
- name: Install borgbackup
3+
when: borg_install_method != "none"
34
block:
45
- name: Include OS-specific variables
56
include_vars: "{{ item }}"

templates/config.yaml.j2

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#jinja2: lstrip_blocks: "True", trim_blocks: "True"
1+
#jinja2: lstrip_blocks: True, trim_blocks: True
22
---
33
# Managed by Ansible, please don't edit manually
44

@@ -19,10 +19,10 @@ location:
1919
repositories:
2020
{% if borg_repository is iterable and (borg_repository is not string and borg_repository is not mapping) %}
2121
{% for repo in borg_repository %}
22-
- {{ repo }}
22+
- path: {{ repo }}
2323
{% endfor %}
2424
{% elif borg_repository is defined and borg_repository is string %}
25-
- {{ borg_repository }}
25+
- path: {{ borg_repository }}
2626
{% endif %}
2727

2828
# Store atime into archive.
@@ -112,10 +112,18 @@ storage:
112112
# Bypass Borg error about a repository that has been moved.
113113
relocated_repo_access_is_ok: {{ borgmatic_relocated_repo_access_is_ok }}
114114

115+
# Bypass Borg error about a previously unknown unencrypted repository.
116+
unknown_unencrypted_repo_access_is_ok: {{ borgmatic_unknown_unencrypted_repo_access_is_ok }}
117+
115118
# Retention policy for how many backups to keep in each category. See
116119
# https://borgbackup.readthedocs.org/en/stable/usage.html#borg-prune for details.
117120
# At least one of the "keep" options is required for pruning to work.
118121
retention:
122+
{% if borg_retention_policy.keep_within is defined %}
123+
# Keep all archives within this time interval.
124+
keep_within: {{ borg_retention_policy.keep_within }}
125+
{% endif %}
126+
119127
{% if borg_retention_policy.keep_secondly is defined %}
120128
# Number of secondly archives to keep.
121129
keep_secondly: {{ borg_retention_policy.keep_secondly }}

vars/RedHat-10.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
borg_dep_packages:
3+
- openssh-clients
4+
5+
borg_cron_package: cronie
6+
7+
borg_pip_packages:
8+
- gcc
9+
- gcc-c++
10+
- libacl
11+
- libacl-devel
12+
- libzstd-devel
13+
- lz4-devel
14+
- openssl-devel
15+
# - python3-devel
16+
- python3-pip
17+
- python3-setuptools
18+
- xxhash
19+
- xxhash-devel
20+
# - python3-virtualenv
21+
# - python3-wheel
22+
23+
borg_distro_packages:
24+
- borgbackup
25+
- borgmatic
26+
27+
python_bin: python3
28+
pip_bin: pip3

0 commit comments

Comments
 (0)