---

- name: Create directories
  file: path={{ item.dir }} state=directory owner={{ item.owner | default(omit) }} group={{ item.group | default(omit) }} mode={{ item.mode | default(omit) }}
  loop:
    - dir: "{{ squashtm_root_dir }}/archives"
      owner: root
      group: root
      mode: 700
    - dir: "{{ squashtm_root_dir }}/meta"
      owner: root
      group: root
      mode: 700
    - dir: "{{ squashtm_root_dir }}/backup"
      owner: root
      group: root
      mode: 700
    - dir: "{{ squashtm_root_dir }}/app"
      mode: 755
    - dir: "{{ squashtm_root_dir }}/logs"
      owner: "{{ squashtm_user }}"
      group: "{{ squashtm_user }}"
      mode: 755
    - dir: "{{ squashtm_root_dir }}/etc"
      owner: "{{ squashtm_user }}"
      group: "{{ squashtm_user }}"
      mode: 755
    - dir: "{{ squashtm_root_dir }}/tmp"
      owner: root
      group: "{{ squashtm_user }}"
      mode: 770
    - dir: "{{ squashtm_root_dir }}/data"
      owner: "{{ squashtm_user }}"
      group: "{{ squashtm_user }}"
      mode: 700
    - dir: "{{ squashtm_root_dir }}/data/tomcat"
      owner: "{{ squashtm_user }}"
      group: "{{ squashtm_user }}"
      mode: 700
  tags: squashtm
