---
- name: Create web root of sites
  file:
    path: "{{ www_root }}/{{ item.key }}/{{ item.value.current_path | default('current') }}/web"
    owner: "{{ web_user }}"
    group: "{{ web_group }}"
    mode: '0755'
    state: directory
  with_dict: "{{ wordpress_sites }}"

- name: Create shared folder of sites
  file:
    path: "{{ www_root }}/{{ item.key }}/shared"
    owner: "{{ web_user }}"
    group: "{{ web_group }}"
    mode: '0755'
    state: directory
  with_dict: "{{ wordpress_sites }}"

- name: Change site owner to user
  file:
    path: "{{ www_root }}/{{ item.key }}"
    owner: "{{ web_user }}"
    group: "{{ web_group }}"
    mode: '0755'
    state: directory
    recurse: yes
  with_dict: "{{ wordpress_sites }}"

---
- name: Create web root of sites
  file:
    path: "{{ www_root }}/{{ item.key }}/{{ item.value.current_path | default('current') }}/web"
    owner: "{{ web_user }}"
    group: "{{ web_group }}"
    mode: '0755'
    state: directory
  with_dict: "{{ wordpress_sites }}"

- name: Create shared folder of sites
  file:
    path: "{{ www_root }}/{{ item.key }}/shared"
    owner: "{{ web_user }}"
    group: "{{ web_group }}"
    mode: '0755'
    state: directory
  with_dict: "{{ wordpress_sites }}"

- name: Change site owner to user
  file:
    path: "{{ www_root }}/{{ item.key }}"
    owner: "{{ web_user }}"
    group: "{{ web_group }}"
    state: directory
    recurse: yes
  with_dict: "{{ wordpress_sites }}"

Remove explicit permission for site directory
Remove explicit permission for site directory

Fixes #1311

The `mode` option was set in https://github.com/roots/trellis/pull/1270
for linting purposes. However, this can result in the permissions
changing on local site files causing them to appear as changed in Git.

Since this directory is guaranteed to exist, we don't need to set
`mode`. The purpose of this task is just to set the owner + group
recursively.
