Closed moregeek closed 1 year ago
Hi and sorry for the delay. I think this is a good change. How about adding this:
borg_packages
variable.Hi m3nu, no problem.
We already have vars for different OS. How about adding the package names there? So users don't need to look them up? This would replace the borg_packages variable.
I decided against the adding of the package names into the existing variable borg_packages
because this would install the packages also when installation method pip is used and would result in installation of the packages via pip and package manager in parallel.
I added a new variable (borg_system_packages
) that contains the name of the borg/borgmatic package as provided by the distributions package manager.
A note about the possibility of outdated distribution packages is added in the README.
Let me know if you need further changes.
Thanks for the changes. I think this makes it a very nice addition.
How about splitting borg_packages
in 2 parts: (not easy to name those)
pip_build_dependencies
: packages needed to build and only needed when borgmatic_install_method: pip
borg_system_packages
: needed to run borg and borgmatic, no matter how it was installed. Cron and openssh mostly.I also adjusted the tests to run the role with both options.
I think this needs EPEL on EL-like distros
TASK [m3nu.ansible_role_borgbackup : Install borgmatic and borg via distribution package manager] ***
failed: [centos-7] (item=borgbackup) => {"ansible_loop_var": "item", "changed": false, "item": "borgbackup", "msg": "No package matching 'borgbackup' found available, installed or updated", "rc": 126, "results": ["No package matching 'borgbackup' found available, installed or updated"]}
failed: [almalinux-9] (item=borgbackup) => {"ansible_loop_var": "item", "changed": false, "failures": ["No package borgbackup available."], "item": "borgbackup", "msg": "Failed to install some of the specified packages", "rc": 1, "results": []}
failed: [almalinux-8] (item=borgbackup) => {"ansible_loop_var": "item", "changed": false, "failures": ["No package borgbackup available."], "item": "borgbackup", "msg": "Failed to install some of the specified packages", "rc": 1, "results": []}
failed: [centos-7] (item=borgmatic) => {"ansible_loop_var": "item", "changed": false, "item": "borgmatic", "msg": "No package matching 'borgmatic' found available, installed or updated", "rc": 126, "results": ["No package matching 'borgmatic' found available, installed or updated"]}
failed: [almalinux-9] (item=borgmatic) => {"ansible_loop_var": "item", "changed": false, "failures": ["No package borgmatic available."], "item": "borgmatic", "msg": "Failed to install some of the specified packages", "rc": 1, "results": []}
failed: [almalinux-8] (item=borgmatic) => {"ansible_loop_var": "item", "changed": false, "failures": ["No package borgmatic available."], "item": "borgmatic", "msg": "Failed to install some of the specified packages", "rc": 1, "results": []}
Added a check to make sure EPEL is enabled for EL distros. Will make sure the tests fail with this and then add EPEL to the test setup, so it succeeds.
Packages on EPEL are pretty broken. No point in testing.
So only thing left is to split borg_packages
as mentioned above. Point being that compiler and dev libs don't get installed when a distro package is used.
Went on to make those changes. borg_packgages
is now split in:
borg_pip_packages
: just needed for building via pipborg_dep_packages
: always installed, no matter the install methodAnd we also have
borg_distro_packages
if installed via package managerAlso renamed a few things to make it more consistent.
@m3nu Thanks for finishing this PR.
This PR allows for using packages provided in the official distribution repository instead of installation via pip. Defaults to
pip
, no impact on existing role usages.Example for arch