---
- hosts: jupyterhub_hosts
  tasks:
    - command: echo "$PATH"
      register: default_path

- hosts: jupyterhub_hosts
  roles:
    - common
    - python
    - { role: newrelic, when: newrelic_license_key is defined and newrelic_license_key != ''}
    - nginx
    - supervisor
    - saveusers
    - bash
    - jupyterhub
    - { role: cull_idle, when: use_cull_idle_servers}
    - nbgrader
  environment:
      PATH: "/opt/conda/bin:{{ default_path.stdout }}"

---

# Make sure Python 2.7 is installed
- hosts: jupyterhub_hosts
  gather_facts: False
  tasks:
    - name: apt-get update
      raw: apt-get update -qq
    - name: Install python 2.7
      raw: apt-get install -qq python2.7

- hosts: jupyterhub_hosts
  tasks:
    - command: echo "$PATH"
      register: default_path

- hosts: jupyterhub_hosts
  roles:
    - common
    - python
    - { role: newrelic, when: newrelic_license_key is defined and newrelic_license_key != ''}
    - nginx
    - supervisor
    - saveusers
    - bash
    - jupyterhub
    - { role: cull_idle, when: use_cull_idle_servers}
    - nbgrader
  environment:
      PATH: "/opt/conda/bin:{{ default_path.stdout }}"

Install Python 2.7 with Ansible on the remote machine
Install Python 2.7 with Ansible on the remote machine
