---

- name: Install build dependencies
  apt:
    name: "{{ item }}"
  sudo: yes
  with_items:
    - git
#    - build-essential
#    - python-dev
    - python-tk
    - tcl8.6-dev
    - tk8.6-dev
    - libffi-dev
    - libssl-dev

- name: Download
  git:
    repo: "https://github.com/girder/girder.git"
    dest: "{{ girder_path }}"
    version: "{{ girder_version }}"
    update: yes
    force: yes
  notify: Build Girder

- name: Install Pillow
  conda:
    name: Pillow
    version: 3.4.2
    executable: "{{ python_dist_path }}/bin/conda"

- name: Install Python dependencies
  pip:
    requirements: "{{ girder_path }}/requirements.txt"
    virtualenv: "{{ python_dist_path }}"
  sudo: yes if python_dist == "system" else no

- name: Install Python package
  pip:
    requirements: "{{ girder_path }}"
    editable: true
    virtualenv: "{{ python_dist_path }}"
  sudo: yes if python_dist == "system" else no

- name: Deploy config file
  template:
    src: "girder.local.cfg.j2"
    dest: "{{ girder_path }}/girder/conf/girder.local.cfg"

#- name: Install NodeJS dependencies
#  npm:
#    name: "{{ item }}"
#    global: yes
#  with_items:
#    - grunt
#    - grunt-cli
#  sudo: yes

---

- name: Install build dependencies
  apt:
    name: "{{ item }}"
  sudo: yes
  with_items:
    - git
#    - build-essential
#    - python-dev
    - python-tk
    - tcl8.6-dev
    - tk8.6-dev
    - libffi-dev
    - libssl-dev

- name: Download
  git:
    repo: "https://github.com/girder/girder.git"
    dest: "{{ girder_path }}"
    version: "{{ girder_version }}"
    update: yes
    force: yes
  notify: Build Girder

- name: Install Pillow
  conda:
    name: Pillow
    version: 3.4.2
    executable: "{{ python_dist_path }}/bin/conda"

- name: Install Python dependencies
  pip:
    requirements: "{{ girder_path }}/requirements.txt"
    virtualenv: "{{ python_dist_path }}"
  sudo: yes if python_dist == "system" else no

- name: Install Python package
  pip:
    name: "{{ girder_path }}"
    editable: true
    virtualenv: "{{ python_dist_path }}"
  sudo: yes if python_dist == "system" else no

- name: Deploy config file
  template:
    src: "girder.local.cfg.j2"
    dest: "{{ girder_path }}/girder/conf/girder.local.cfg"

#- name: Install NodeJS dependencies
#  npm:
#    name: "{{ item }}"
#    global: yes
#  with_items:
#    - grunt
#    - grunt-cli
#  sudo: yes

Fix installing Girder Python package
Ansible: Fix installing Girder Python package
