#!/usr/bin/env ansible-playbook
#
# Usage: 
#
# ./project_environment -i hosts -l $HOSTNAME
#
- name: Install and configure octonet
  hosts: all
  vars:
      project_dest: "{{base_dir}}/octonet"
      project_base: "{{base_dir}}/octonet"
      project_local_settings: "{{base_dir}}/octonet/octonet/local_settings.py"
      git_branch: "master"
  roles:
      - jessie-py3-django18
      # - postgres_database
  tasks:
      # ****** Install dependencies from Debian ****** #

      # - name: install project-specific dependencies from Debian
      #   apt:
      #       name: python3-babel,python3-reportlab,python3-prettytable,python3-mimeparse,python3-numpy
      #       state: present
      #       update_cache: no

      # - name: enable truelite packages
      #   apt_repository:
      #       repo: 'deb http://debian.truelite.it/debian/ jessie-truelite main'
      #       state: present
      #   when: ansible_distribution == 'Debian' and
      #         ansible_distribution_release == 'jessie'

      # - name: install truelite dependencies
      #   apt:
      #       # TODO: remove python3-django-extensions after #843975 is fixed
      #       name: python3-django-countries,python3-django-gcm,python3-django-tastypie,python3-model-mommy,python3-babeldjango,python3-django-extensions,python3-django-pettycash
      #       state: present
      #       update_cache: yes
      #       default_release: jessie-truelite
      #   when: ansible_distribution == 'Debian' and
      #         ansible_distribution_release == 'jessie'

      # ****** Setup / update the DB, static and translation files ****** #
      - include: ansible_common/includes/django_deploy.yaml
