---

- name: Install Girder system dependencies
  apt:
    name: "{{ item }}"
  become: yes
  become_user: root
  with_items:
    - git
    - libffi-dev
    - build-essential
    - python2.7-dev
    - python-pip
    - libjpeg-dev
    - libssl-dev
    - zlib1g-dev
  when: ansible_os_family == "Debian"

- name: Install Girder system dependencies
  yum:
    name: "{{ item }}"
  become: yes
  become_user: root
  with_items:
    - curl
    - gcc-c++
    - git
    - libffi-devel
    - make
    - openssl-devel
    - libjpeg-turbo-devel
    - zlib-devel
    - python2-pip
    - python-devel
  when: ansible_os_family == "RedHat"

- name: Download Girder
  git:
    repo: "https://github.com/girder/girder.git"
    dest: "{{ girder_path }}"
    version: "{{ girder_version }}"
    update: "{{ girder_update|default(omit) }}"
    force: "{{ girder_force|default(omit) }}"
    clone: "{{ girder_clone|default(omit) }}"
  register: vc

- set_fact:
    girder_files_updated: "{{ vc.changed }}"

---

- name: Install Girder system dependencies
  apt:
    name: "{{ item }}"
  become: yes
  become_user: root
  with_items:
    - git
    - libffi-dev
    - build-essential
    - python2.7-dev
    - python-pip
    - libjpeg-dev
    - libssl-dev
    - zlib1g-dev
    # Needed for LDAP plugin
    - libsasl2-dev
    - libldap2-dev
  when: ansible_os_family == "Debian"

- name: Install Girder system dependencies
  yum:
    name: "{{ item }}"
  become: yes
  become_user: root
  with_items:
    - curl
    - gcc-c++
    - git
    - libffi-devel
    - make
    - openssl-devel
    - libjpeg-turbo-devel
    - zlib-devel
    - python2-pip
    - python-devel
    - openldap-devel
  when: ansible_os_family == "RedHat"

- name: Download Girder
  git:
    repo: "https://github.com/girder/girder.git"
    dest: "{{ girder_path }}"
    version: "{{ girder_version }}"
    update: "{{ girder_update|default(omit) }}"
    force: "{{ girder_force|default(omit) }}"
    clone: "{{ girder_clone|default(omit) }}"
  register: vc

- set_fact:
    girder_files_updated: "{{ vc.changed }}"

Install necessary libraries for ldap.
Install necessary libraries for ldap.
