---

- name: Setup Drupal Redis
  hosts: tag_Role_Drupal-Redis
  roles:
    - role: dosomething.redis

- name: Setup Drupal WebApp
  hosts: tag_Role_Drupal-WebApp
  roles:
    - role: dosomething.web
    - role: dosomething.dosomething

# sudo mount -t nfs -o nolock 10.100.20.6:/drupal-static-files /mnt
- name: Mount shared folder to Drupal WebApp
  hosts: tag_Role_Drupal-WebApp
  tasks:
  - name: Install nfs-common
    sudo: yes
    apt: name=nfs-common state=latest
  - name: Ensure mount directory exists
    sudo: yes
    file: >
      path={{ app_shared }}/files
      state=directory
      owner={{ app_user }}
      follow=yes
  - name: Mount NFS
    remote_user: "{{ app_user }}"
    command: mount -t nfs -o nolock 10.100.20.6:/drupal-static-files {{ app_shared }}/files

---

- name: Setup Drupal Redis
  hosts: tag_Role_Drupal-Redis
  roles:
    - role: dosomething.redis

- name: Setup Drupal WebApp
  hosts: tag_Role_Drupal-WebApp
  roles:
    - role: dosomething.web
    - role: dosomething.dosomething

# sudo mount -t nfs -o nolock 10.100.20.6:/drupal-static-files /mnt
- name: Mount shared folder to Drupal WebApp
  hosts: tag_Role_Drupal-WebApp
  tasks:
  - name: Install nfs-common
    sudo: yes
    apt: name=nfs-common state=latest
  - name: Mount NFS
    sudo: yes
    mount: >
      name=/var/www/www.dosomething.org/shared/files
      src='10.100.20.6:/drupal-static-files'
      fstype=nfs
      opts=nolock
      state=mounted

Revert "Production: mount shared folder as app user."
Revert "Production: mount shared folder as app user."
