I wanted to share a small playbook I’m using to sync the uploads between different environments (local to staging, local to prod or vice-versa).
Usage is really simple, drop in at the root of Trellis (where the other roles like
server.yml are and use it like this:
ansible-playbook uploads.yml -i hosts/staging --extra-vars="site=example.com mode=pull"
staging can be replaced by
production depending of the environment you want,
example.com is the name of the key in Trellis environment file (the same that you use to deploy a site) and
pull depending on what you want to do with the uploads. When
mode is omitted, it will default to
I hope it can be useful to someone!