Skip to content

Instantly share code, notes, and snippets.

@louim
Last active December 23, 2022 14:20

Revisions

  1. louim revised this gist Jul 21, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions uploads.yml
    Original file line number Diff line number Diff line change
    @@ -8,15 +8,15 @@
    project_root: "{{ www_root }}/{{ site }}"

    tasks:
    # ansible-playbook uploads.yml -i hosts/staging --extra-vars="site=example.com mode=pull"
    # ansible-playbook uploads.yml -i hosts/staging --extra-vars="site=example.com mode=push"
    - name: Push uploads
    synchronize:
    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="site=example.com mode=push"
    # ansible-playbook uploads.yml -i hosts/staging --extra-vars="site=example.com mode=pull"
    - name: Pull uploads
    synchronize:
    src: "{{ project_root }}/current/web/app/uploads/"
  2. louim revised this gist Jul 21, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions uploads.yml
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@
    # ansible-playbook uploads.yml -i hosts/staging --extra-vars="site=example.com mode=pull"
    - name: Push uploads
    synchronize:
    src: "../site/web/app/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"
    @@ -20,7 +20,7 @@
    - name: Pull uploads
    synchronize:
    src: "{{ project_root }}/current/web/app/uploads/"
    dest: "../site/web/app/uploads/"
    dest: "{{ project.local_path }}/web/app/uploads/"
    mode: pull
    rsync_opts: --exclude=.DS_Store
    when: mode is defined and mode == "pull"
  3. louim created this gist Jul 4, 2015.
    26 changes: 26 additions & 0 deletions uploads.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    ---
    - name: Sync uploads between environments
    hosts: web
    remote_user: "{{ web_user }}"

    vars:
    project: "{{ wordpress_sites[site] }}"
    project_root: "{{ www_root }}/{{ site }}"

    tasks:
    # ansible-playbook uploads.yml -i hosts/staging --extra-vars="site=example.com mode=pull"
    - name: Push uploads
    synchronize:
    src: "../site/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="site=example.com mode=push"
    - name: Pull uploads
    synchronize:
    src: "{{ project_root }}/current/web/app/uploads/"
    dest: "../site/web/app/uploads/"
    mode: pull
    rsync_opts: --exclude=.DS_Store
    when: mode is defined and mode == "pull"