---

- name: Create directories
  file: path={{ fpbx_root_dir }}/{{ item.dir }} state=directory owner={{ item.owner | default(omit) }} group={{ item.group | default(omit) }} mode={{ item.mode | default(omit) }}
  loop:
    - dir: web
    - dir: cgi-bin
    - dir: meta
      mode: 700
    - dir: backup
      mode: 700
    - dir: tmp
    - dir: sessions
    - dir: archives
    - dir: web/admin/modules/ucp/
    - dir: provisioning/contacts
    - dir: provisioning/logs
    - dir: provisioning/overrides
    - dir: provisioning/licenses
    - dir: provisioning/bmp
    - dir: provisioning/config_bkup/contacts
  tags: fpbx

- name: Create /tftpboot
  file: dest=/tftpboot src={{ fpbx_root_dir }}/provisioning state=link
  tags: fpbx

