---
- hosts: all
  become: true

  vars:
    util_base: "{{ playbook_dir | dirname }}"
    www_base: "{{ util_base | dirname }}"
    app_base: "{{ www_base | dirname }}"
    tmp_base: "{{ app_base }}/www_tmp"
    app_env: "production"
    update_mode: true
    update_revision: 1

  environment:
    DEBIAN_FRONTEND: noninteractive

  roles:
    - role: "init"

    - role: "azuracast-config"

    - role: "azuracast-radio"
      when: update_revision|int < 77

    - role: "supervisord"
      when: update_revision|int < 79

    - role: "mariadb"
      when: update_revision|int < 63

    - role: "nginx"
      when: update_revision|int < 81

    - role: "redis"
      when: update_revision|int < 57

    - role: "beanstalkd"
      when: update_revision|int < 67

    - role: "php"
      when: update_revision|int < 78

    - role: "composer"

    - role: "influxdb"
      when: update_revision|int < 58

    - role: "ufw"
      when: update_revision|int < 12

    - role: "dbip"
      when: update_revision|int < 51

    - role: "services"
      when: update_revision|int < 13

    - role: "azuracast-cron"
      when: update_revision|int < 72

    - role: "azuracast-build"

    - role: "azuracast-setup"
