borgbase / ansible-role-borgbackup

Ansible role to set up Borg and Borgmatic
MIT License
229 stars 102 forks source link

unusual YAML syntax for hooks #117

Open ramcq opened 1 year ago

ramcq commented 1 year ago

I have a healthchecks hook set up:

borgmatic_hooks:
  healthchecks: https://hc-ping.com/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

The generated YAML file is as follows:

hooks:
    healthchecks:
        https://hc-ping.com/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
        ...

The ... appears to imply that to_nice_yaml has truncated something, but nothing has been truncated. Perhaps it's harmless but it does look odd. I was digging around to try and find why this was happening, and it does seem that to_nice_yaml has some odd side effects of truncating/splitting tokens longer than 80 characters, which seems extremely undesirable. However, this token is less than 80 characters so adding width= didn't change anything. I can't work out why the ... is being added at all.

ramcq commented 1 year ago

Oh, this actually broke my healthcheck. Found a potential fix.

conloos commented 1 year ago

Hello @ramcq ,

I have written a macro to generate clean yaml. Maybe this is a solution.

Greetings Frank