borgmatic_hooks compatibility with string hooks
Some very useful monitoring hooks (like "healthchecks") are defined with a simple string.
The current template is not compatible.
Oh, we want both of course. How can we improve this. Basically all those cases should work, right?
Would a simple Jinja2 IF be sufficient? If it's a string, just write hook+string. Else format YAML, as we do now.
borgmatic_hooks:
before_backup:
- echo "`date` - Starting backup."
postgresql_databases:
- name: all
hostname: mysql.internal
username: postgres
password: xxx
healthchecks: "https://hc-ping.com/your-uuid-here"
Yep. It seems reasonable to me. 👌
It works now, by simply adding something like:
borgmatic_hooks:
healthchecks:
ping_url: https://yourhealthchecks.com/ping/your-random-guid
🍻
Yeah, I changed this a few months back to pass the YAML right to Borgmatic. Needed it for database hooks. Glad it helped for this too.