Commit Graph

120 Commits

Author SHA1 Message Date
Emiel Molenaar
4cb112712b
Add support for custom configuration for borgmatic (#195)
* Add support for custom configuration for borgmatic
* Restrict borgmatic_custom_config to version 1.8+
2026-01-06 14:43:47 +00:00
Manu
51e099e553 Allow skipping SSH key and config generation
Add when conditions to skip SSH key generation and borgmatic config
creation when corresponding variables are empty. This allows users
to install only borg/borgmatic without configuring them.

Closes #188 #152

Co-Authored-By: Leonidas Avdelas <avdelasleonidas@gmail.com>
2026-01-05 13:42:10 +00:00
Manu
c6dd6f9a70
Merge pull request #185 from aphick/master
Add option to control NoNewPrivileges in borgmatic.service
2026-01-05 13:40:24 +00:00
Manu
b1bad2a69e
Merge pull request #187 from KickerTom/VersionFix
Add support for configuration syntax of borgmatic > 1.8.0
2026-01-05 13:40:17 +00:00
Manu
63ebe59e70 Merge upstream/master and resolve conflicts
- Incorporate retries and retry_wait options from master
- Adapt new options to both legacy (1.7) and new (1.8+) config formats

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 13:20:38 +00:00
Manu
1d16b64d24 Improve borgmatic version handling and fix deprecated options
- Rename templates to version-based naming (config_1.7.yaml.j2)
- Use command module instead of shell for version detection
- Add check_mode: false for version detection task
- Fix deprecated remote_rate_limit → upload_rate_limit for 1.8+

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 13:15:40 +00:00
Leonidas Avdelas
ddd52f3f67 Add retries in meta spec and README
Signed-off-by: Leonidas Avdelas <avdelasleonidas@gmail.com>
2025-11-18 07:18:00 +00:00
Leonidas Avdelas
88dc6da60e Add retries and retry-wait
Signed-off-by: Leonidas Avdelas <avdelasleonidas@gmail.com>
2025-11-18 07:18:00 +00:00
Tomas Kopal
0ff3e2f38e Use name for setting a fact, fixes ansible-lint error. 2025-11-05 15:28:28 +01:00
Tomas Kopal
c700844f75 Add support for configuration syntax of borgmatic > 1.8.0 2025-10-24 15:12:13 +02:00
aphick
3d5e749ee6 add borgmatic_systemd_nonewprivileges to borgmatic.service.j2 2025-08-18 12:01:19 -07:00
Dirk Sarpe
a960af0cf4 adds keep_within setting to borg_retention_policy
option is available upstream
2025-08-17 18:34:01 +01:00
Nish_
4faab60075 add option borgmatic_unknown_unencrypted_repo_access_is_ok
Signed-off-by: Nish_ <120EE0980@nitrkl.ac.in>
2025-07-09 18:38:43 +01:00
AJ Jordan
0dd2f88033 Add none installation method 2025-07-09 18:37:42 +01:00
Bert-Jan Fikse
e3397c62f7 fix: use path as key for repositories config 2025-07-09 18:37:16 +01:00
Manu
9ab81e461e Support for RHEL10 2025-07-09 18:33:43 +01:00
hydrandt
b12f97a11f #180 config.yaml.j2 jinja2 trim_blocks string -> boolean 2025-05-14 01:04:54 +01:00
Max Fuxjäger
e2f8e75155 Fix linting messages
- fix truthy values to proper booleans
- fix too long lines: wrapped
- fix indentation
- fix amount of preceding whitespace
- fix argument_spec syntax: borg_retention_policy as type dict with specific options
2025-04-28 19:59:35 +01:00
Matthias Stegmann
320975170d Add option to add flags to borgmatic in cron/systemd-timer job 2025-04-07 16:03:00 +01:00
Matthias Stegmann
4c7f8d86bf Add option to set ssh key comment 2025-04-04 23:29:03 +01:00
AJ Jordan
c91bf0e9b4 Remove unneeded execute bit on YAML file 2025-03-31 10:44:25 +01:00
AJ Jordan
e179627077 Extract asserts into their own file
These don't really belong in the "install" file.
2025-03-30 12:38:01 +01:00
Aaron
781f1226e7
Fix hook indention. By @Jaffr0 (#168)
Co-authored-by: Aaron Paterson <81300255+Jaff-ro@users.noreply.github.com>
2024-12-16 21:47:45 +00:00
Manu
ed8fe0d345
Indent hook name (#159) 2024-12-09 15:32:39 +00:00
Manu
efa8e5ec7f
fix borgmatic_hooks indention (#155) 2024-10-25 16:32:15 +01:00
Manu
2f4966fff3 Add missing arg_spec: borgmatic_version 2024-10-22 10:37:28 +01:00
berumuron
e9161f596e
Add borgmatic_timer_hour and borgmatic_timer_minute to argument_specs.yml (#154) 2024-10-18 14:17:33 +01:00
Manu
c8a295aa26
Test and dependency fixes (#153) 2024-10-18 11:35:39 +01:00
kaufe
ad163fec68
Add possibility to overwrite compression (#116)
Co-authored-by: Alexander Kaufmann <akaufman@DESKTOP-K5ID02T.localdomain>
2024-10-18 09:01:21 +01:00
jerome.gagnon
ab8dd529b8 fixes tests 2024-10-18 08:57:07 +01:00
Jerome Gagnon
8f52fbe8e5 Rename argument_spec.yml to argument_specs.yml
ok, got it this time.
2024-10-18 08:55:54 +01:00
Jerome Gagnon
637a951e21 Rename arguments_spec.yml to argument_spec.yml 2024-10-18 08:55:54 +01:00
Jerome Gagnon
d511f30e04 Rename arguments_specs.yml to arguments_spec.yml
Closes #141
2024-10-18 08:55:54 +01:00
AJ Jordan
0e5e876626 Fix Debian install failures due to missing libs 2024-08-14 08:26:11 +01:00
AJ Jordan
84b0030581
Fix malformed config if no passphrase set (#148) 2024-03-12 08:44:43 +00:00
Woomy
702299f861
Don't fail if cron isn't installed when setting up systemd timer (#147)
* `cron` isn't always installed and is not required when using a systemd
  timer, so make sure setup doesn't fail when we check if there's
  already an installed cron timer

Signed-off-by: Woomymy <woomy@woomy.be>
2024-03-07 21:11:02 +00:00
Kamil Essekkat
cbe280e7ff
docs: Repositories can be a list (#134) 2023-06-18 15:02:05 +01:00
Manu
f5d7a0afb6
Update namespace (#129) 2023-05-16 08:07:46 +02:00
Manu
07c853663c
Set default minimum borgmatic version to match config format (#127) 2023-04-26 20:34:53 +01:00
Sam Hartsfield
7efeb1be5e
Fix failing on EPEL check in Fedora (#111)
* Fix failing on EPEL check in Fedora

Only applies when using the "package" install method.
Added a separate variable "borg_require_epel" to make it easy to disable
the check in any other situations (e.g. using a custom mirror instead of
the epel-release package).

* Explain default value of borg_require_epel
2023-04-19 11:07:29 +01:00
Manu
2f57fce727 Remove deprecated Borgmatic option. 2023-04-05 21:12:32 +01:00
Frank Dornheim
dd960dcf4e
Restructure role, add Systemd timer option. By @conloos (#112)
* add full path

* Update Readme.me: reorder optional Arguments, update cron -> systemd timer

* remove ssh_key_file; change cron to timer

* Removed cronie from package installation because systemd timer is used

* docker.sh - Stops all or selected containers to save the persistent data intact. The containers are started in reverse order

* Created arguments_specs.yml

* Role restructured:
  - if needed creation of a service user incl. creation of the ssh-key,
  - add the ssh key to authorized_keys,
  - auto init of the repos,
  - creation and start of systemd timer and services and
  - installation of the Docker helperscript.

* restructure role add import logic

* cleanup: user backup_user

* - "borg_source_directories" is not longer a required Argument
- add "borg_keys_directory" to load key from Service user during starting borgmatic by sudo

* Add borgmatic_initialization_repo (bool) as option to disable init of repo

* cleanup

* fix ansible-lint errors and warnings

* fix letter turner

* add option: borgmatic_timer

* add:
  - borgmatic_timer_systemd: true
readd:
  - borgmatic_cron_name: "borgmatic"

* - renamed borgmatic_cron_name to borgmatic_timer_cron_name to be more convergent.
- Change recommendations implemented by m3nu so that creation of a timer (systemd or cron) is optional and can be selected via borgmatic_timer.

* Add description to borgmatic_timer_cron_name and borgmatic_timer

* Add variable borg_cron_package to install the cron-packages in case of using timer: cron

* reworked timer install logic

* reworked timer install logic

* Add comments for running backup with service account

* add new parameters for tests

* Switch created to perform the backup as root or service account. If a service account is to be used, it will be created.

* Refactored: Check for ssh-key if not present, genereate them.

* Refactored

* Refactored

* renamed tasks/03_configure.yml to tasks/04_create_links_to_borg_and_borgmatic.yml

* Refactored

* Refactored

* add example for service account

* Update Python version for testing

* No auto init

* Add description to install_backup

* Add description to install_backup

* set coverage back to: m3nu.ansible_role_borgbackup

* The initialization of the repository must be activated and does not take place automatically.

* The initialization of the repository must be activated and does not take place automatically.

* Removed install_backup as var (bool) to prevent that this role run

* Rename backup_ssh_command to borg_ssh_command, tis was a double definition

* Renamed backup_repository to borg_repository and add better explanations

* remove copy ssh-keys and cert parts

* Add comments to borg_ssh_key_file and borg_ssh_key_type

* Set allways the borg_ssh_key_file and borg_ssh_command to load the right ssh-key. Add borg_ssh_key_type to select the key type by user

* Add borg_ssh_key_type

* renamed id_rsa to backup

* generate ssh-keys (backup and backup.pub) and add better explanation

* Print out key if borgmatic_initialization_repo is false

* Remove 'su - {{ borgbackup_user }} -c' to execute the borgmatic by the right user

* Add Check frequency, therefore, we no longer need to distinguish between normal and large repos

* Add link to Article

* renamed backup_ssh_command and backup_ssh_key_file to borg_ssh_command and borg_ssh_key_file

* Removed: borgmatic_initialization_repo

* Removed: borgmatic_initialization_repo

* Removed: borgmatic_initialization_repo

* revert changes

* Add Full Automation

* polishing

* rename backup.timer and bakup.service to borgmatic.timer and borgmatic.service

* remove debug

* Try to find services in ansible_facts

* Forgot to install Cron

* change borg_ssh_key_type to ed25519

* remove conditional checks

* - add hint to using a service user
- renamed: borg_ssh_key_file to borg_ssh_key_file_path
- removed advanced example

* add borg_ssh_key_name, renamed borg_ssh_key_file to borg_ssh_key_file_path

* removed static pointing to ~/.ssh/backup SSH private key

* Add README-Advanced-Examples.md for storing more examples

* Fix test idempotence

* Dont symlink when using distro packages

* Remove old test targets, consistent wording, remove tag

* Remove helper scripts, fix absolute path

* Fix cron job, add assert to prevent duplicate timers

* nit-pick

* Create bin links as root, no borg_ssh_command by default.

* Add breaking changes note to README

---------

Co-authored-by: Manu <manu@snapdragon.cc>
2023-03-28 18:01:12 +01:00
Stefan Morgenthaler
981d4f9072
Allow to installation via OS package manager or pip (#106)
* allow to installation via os package manager or pip

* Run a second time to install via package manager

* Check for EPEL if distro package requested.

* Split dep lists to avoid installing build deps when using distro pkg

Co-authored-by: Stefan Morgenthaler <dev@morgenthaler.at>
Co-authored-by: Manu <manu@snapdragon.cc>
2022-12-15 17:40:53 +01:00
Sébastien Clément
e34f9311d8
Allow setting borg/borgmatic version (#107) 2022-11-22 20:54:31 +01:00
Manu
e1ba1d1364
Adjust Borgmatic arguments for v1.7.0 (#102) 2022-09-03 11:07:50 +02:00
Manuel Riel
1def545c86
Remove borgbase module, now separate (#100) 2022-05-13 11:17:47 +04:00
Luc Stroobant
740e9fe758
Upgrade pip and setuptools during installation. By @stroobl (#95) 2022-03-06 10:01:25 +04:00
Manu
8429ec5bc1
Support Borg 1.2.0 (#94)
* Move common Python packages to main.yml, install dependent Python packages first.
2022-02-28 10:28:37 +04:00
Manu
29d0c5f480
Unify all Borgmatic hooks in one variable (#93) 2022-02-20 14:42:09 +04:00
Manu
bb5b6afd4c
Add RHEL9 support, fix empty exclude option (#92) 2022-02-20 13:56:14 +04:00