---

- 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 }}"

---

- name: Install Girder system dependencies
  apt:
    name: "{{ item }}"
  become: yes
  become_user: root
  with_items:
    - curl
    - 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 }}"

Add curl to Ansible system dependencies
Add curl to Ansible system dependencies

This already existed for the RedHat version, but not Debian. This is
particularly noticeable when using this role to install on the default
Ubuntu Docker image which doesn't come preinstalled with curl.
