It turns out restic is a bit less trivial to set up with Amazon’s S3
due to some incoherency in URI handling by Amazon S3 leading to subtle
problems with repo initialization where
restic init is only fine with
a specific variant of the S3 bucket URI and all other
restic commands would
work with another one. While the linked bug is about Scaleway’s object storage,
the problem encountered also applied to AWS S3.
This post documents an Ansible sample variable setup to automatically generate proper restic repository paths.