---
- name: Install dependencies
  apt:
    state: present
    name:
    - bzip2
    - php-gd
    - php-json
    - php-xml
    - php-mbstring
    - php-zip
    - php-curl
    - php-bz2
    - php-intl
    - php-gmp
    - php-apcu
    - php-redis
    - php-bcmath
    - php-imagick
    - libmagickcore-6.q16-6-extra
  tags:
    - nextcloud

# dependency for mysql_user and mysql_db - python2
- name: python modules is installed (Ansible dependency)
  apt:
    name:
      - python-mysqldb
      - python-pymysql
    state: present
  tags:
    - nextcloud
  when: ansible_python_version is version('3', '<')

# dependency for mysql_user and mysql_db - python3
- name: python3 modules is installed (Ansible dependency)
  apt:
    name:
      - python3-mysqldb
      - python3-pymysql
    state: present
  tags:
    - nextcloud
  when: ansible_python_version is version('3', '>=')

- include: apache-system.yml

- include: user.yml

- include: archive.yml

- include: apache-vhost.yml

- include: mysql-user.yml

- include: config.yml
