borgbase / ansible-role-borgbackup

Ansible role to set up Borg and Borgmatic
MIT License
229 stars 102 forks source link

Allow multiple commands to be defined for custom hooks #77

Closed tjheske closed 2 years ago

tjheske commented 3 years ago

Borgmatic allows running multiple commands for each hook. The role already allows this for before_backup, after_backup and on_error. This PR allows this also for any other hook to be defined by the user.

To keep compatibility with existing configs, I added the variable borgmatic_hooks_multiple_commands, which is false by default.

m3nu commented 3 years ago

Good change, but can we make it happen without adding another argument borgmatic_hooks_multiple_commands? E.g. by checking the input type for borgmatic_hooks? Goal would be to:

m3nu commented 3 years ago

This just bit me as I needed DB hooks. Hope the syntax can be a bit more readable. I know we are parsing yaml to yaml...

m3nu commented 2 years ago

Should be possible with #93