Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add if around exclude options to prevent yaml error #72

Merged
merged 1 commit into from
Aug 5, 2021

Conversation

Kogelvis
Copy link
Contributor

@Kogelvis Kogelvis commented Aug 5, 2021

On a new CentOS 7 system without setting the borg_exclude_patterns and borg_exclude_from variables borgmatic will complain about an invalid configuration file:

summary:
/etc/borgmatic/config.yaml: Error parsing configuration file
An error occurred while parsing a configuration file at /etc/borgmatic/config.yaml:
At 'location.exclude_patterns': None is not of type 'array'
At 'location.exclude_from': None is not of type 'array'

This was after deploying and issuing borgmatic -I -e repokey

This change will omit the respective settings when they are empty and thus preventing a configuration error.

@m3nu
Copy link
Collaborator

m3nu commented Aug 5, 2021

Good catch! Thanks! 🙏 Let's run CI and then merge this.

@m3nu m3nu merged commit b52efea into borgbase:master Aug 5, 2021
@Kogelvis
Copy link
Contributor Author

Kogelvis commented Aug 5, 2021

You're welcome and thanks for merging 🙂

kitos9112 pushed a commit to kitos9112/ansible-role-borgbackup that referenced this pull request Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants