Merging multiple include files leads to validation error #380
Labels
No labels
blocked
breaking
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
borgmatic-collective/borgmatic#380
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'm trying to do and why
My config files are split into multiple includes (as a consequence of working around #281). I'm also using includes to isolate passphrases from config files (so that only the passphrase include files need to be restricted to root access only). So I am trying to merge two include files under
storage.Steps to reproduce (if a bug)
Set up a config file with something like:
Run
validate-borgmatic-config.Actual behavior (if a bug)
validate-borgmatic-configreturns an error:Expected behavior (if a bug)
I can merge multiple include files.
Other notes / implementation ideas
I've tried multiple plain
!includeincludes, and mixing one!includeand one<<: !include, but none of these validate either.Environment
borgmatic version: 1.5.1
borgmatic installation method: Ubuntu package
Borg version: 1.1.14
Python version: 3.8.6
Database version (if applicable): N/A
operating system and version: Ubuntu 20.10
Sorry for the lengthy delay here. I think this behavior is a limitation of the YAML parsing library borgmatic uses—and possibly of YAML itself.
However, with #381 (deep merging) now implemented in master, it's possible that you'll be able to get rid of all of your per-section includes and move those to a common include for the whole file. Example:
Does that seem like it'd work for your use case?
Closing for now given the work-around, but please feel free to re-open if you have additional follow-up. Thanks!
Apologies for the late reply. I haven't tried the new deep merging includes yet so I'm not sure how it interacts with other includes (my setup is more complicated than the given example).
I don't mind keeping this issue closed, though as an end user I still find it unintuitive that only one include is allowed per section.
I agree.. I'll try to document this limitation better! And feel free to reopen this ticket if the deep merging doesn't end up working for your use case.