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

Configuring backup tasks skipped when "restic_backups" is a dict #105

Open
usmanatron opened this issue Sep 4, 2023 · 2 comments
Open
Labels
help wanted Extra attention is needed

Comments

@usmanatron
Copy link
Contributor

When the restic_backups object is a dictionary, everything after (BACKUP) reformat dict if necessary gets skipped. If you instead use an array it works fine.

After some investigation, I think it's to do with how the aforementioned task works. After placing a debug task just after it, it appears that restic_backups isn't transformed as wanted (i.e. it's the same dict). This isn't because of the jinja expression - I'm using that to transform my dict at role invocation => it does what we want.

I recall reading somewhere that you can't set a fact on top of itself - if thats indeed the case then the fix is to edit that task such that it sets the new fact as a different name.

@usmanatron
Copy link
Contributor Author

Another thought - looking at this SO thread answer it may actually be to do with variable precedence.
Since set_facts output has a low precedence, we end up not overriding it as we expect. The workaround is the same: change the name of the new fact

@DO1JLR DO1JLR added the help wanted Extra attention is needed label Jan 3, 2024
@markstos
Copy link
Contributor

markstos commented Apr 5, 2024

@usmanatron Please share the Ansible version you experienced this with, and provide a playbook which reproduces it. See #122 for an example.

Also, test with the most recent version of this role. Before, there was a dependency on jmespath for this reformatting, but that dependency was just removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Development

No branches or pull requests

3 participants