ansible-role-borgbackup icon indicating copy to clipboard operation
ansible-role-borgbackup copied to clipboard

properly merge borgmatic_hooks and extra variables

Open HarHarLinks opened this issue 4 years ago • 1 comments

at least 3 extra variables failure_command, before_backup and after_backup are introduced while the rest of the hooks configuration has to be added manually in the hooks variable. https://github.com/borgbase/ansible-role-borgbackup/blob/b52efea18e02840a56046936f6b3a76e44d8c946/templates/config.yaml.j2#L179-L200

this can cause errors like the following if one configures the role using e.g. on_error instead of failure_command:

Message: Validation_error('/etc/borgmatic/config.yaml', ('while constructing a mapping\n  in "/etc/borgmatic/config.yaml", line 123, column 5\nfound duplicate key "on_error" with value "[]" (original value: "[]")\n  in "/etc/borgmatic/config.yaml", line 135, column 5\n\nTo suppress this check see:\n    http://yaml.readthedocs.io/en/latest/api.html#duplicate-keys\n',))

I suggest this should be documented more clearly and further avoided altogether by merging these variables appropriately.

HarHarLinks avatar Oct 10 '21 16:10 HarHarLinks

Yeah, agreed.

m3nu avatar Oct 13 '21 14:10 m3nu