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

borgmatic_hooks indentation broken in rendered config #157

Closed
TheAssassin opened this issue Nov 7, 2024 · 7 comments · Fixed by #159
Closed

borgmatic_hooks indentation broken in rendered config #157

TheAssassin opened this issue Nov 7, 2024 · 7 comments · Fixed by #159
Assignees
Labels

Comments

@TheAssassin
Copy link

After #155, the indentation of borgmatic_hooks is broken. The hooks now live on the root indentation level and are no longer children of hooks: in the rendered configuration file.

Using 1.1.0 works fine. I'm not sure what the motivation behind #155 was, but it introduced this regression.

The obvious fix is to use | indent(4) or similar on the {{ hooks }} line, too, I suppose.

@holzi1005
Copy link

I have the same issue. The borgmatic_hooks do not look good and will result in an error.

@m3nu
Copy link
Collaborator

m3nu commented Nov 21, 2024

True. I also had to correct this a few times.

@m3nu m3nu added the type:bug label Nov 21, 2024
@m3nu m3nu self-assigned this Nov 23, 2024
@m3nu m3nu mentioned this issue Nov 23, 2024
@m3nu
Copy link
Collaborator

m3nu commented Nov 23, 2024

Added very simple PR. Would be great if someone can confirm this works for their case. Result of my test:

Screenshot 2024-11-23 at 14 50 14

@m3nu
Copy link
Collaborator

m3nu commented Dec 4, 2024

Fixed via #155

@m3nu m3nu closed this as completed Dec 4, 2024
@user171
Copy link

user171 commented Dec 9, 2024

I'm using 1.1.0 and the resulting config file gives an error with hooks.
The resulting indentation seems wrong :

hooks:
on_error:
    - echo "`date` - Error while creating a backup."

before_backup:
    - echo "`date` - Starting backup."

after_backup:
    - echo "`date` - Finished backup."

Indenting manually works.

@m3nu
Copy link
Collaborator

m3nu commented Dec 9, 2024

Sorry for the delay in releasing this, @user171. Was held up by a CI issue. New release with this fix is now out on Ansible Galaxy: https://galaxy.ansible.com/ui/standalone/roles/borgbase/ansible_role_borgbackup/

@user171
Copy link

user171 commented Dec 10, 2024

No worries, thanks for the great work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants