Skip to content

Instantly share code, notes, and snippets.

Last active December 23, 2022 14:20
  • Star 37 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Drop-in playbook for Trellis to push and pull uploads from the server to your local machine.
- name: Sync uploads between environments
hosts: web
remote_user: "{{ web_user }}"
project: "{{ wordpress_sites[site] }}"
project_root: "{{ www_root }}/{{ site }}"
# ansible-playbook uploads.yml -i hosts/staging --extra-vars=" mode=push"
- name: Push uploads
src: "{{ project.local_path }}/web/app/uploads/"
dest: "{{ project_root }}/current/web/app/uploads/"
rsync_opts: --exclude=.DS_Store
when: mode is not defined or mode == "push"
# ansible-playbook uploads.yml -i hosts/staging --extra-vars=" mode=pull"
- name: Pull uploads
src: "{{ project_root }}/current/web/app/uploads/"
dest: "{{ project.local_path }}/web/app/uploads/"
mode: pull
rsync_opts: --exclude=.DS_Store
when: mode is defined and mode == "pull"
Copy link


Copy link

manuweg commented Dec 23, 2022

Thanks. This works perfectly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment