- name: Update APT package cache
  apt: update_cache=yes

- name: Install system packages
  apt: >
    name={{ item }} state=latest
  with_items:
    - sudo
    - python-software-properties
    - sqlite3
    - supervisor
    - nginx

- name: Install python2 packages
  when: openwisp2_python in ["python2.7", "python2"]
  apt: >
    name={{ item }} state=latest
  with_items:
    - python-pip
    - python-dev
    - python-virtualenv

- name: Install python3 packages
  when: openwisp2_python == "python3.4"
  apt: >
    name={{ item }} state=latest
  with_items:
    - python3
    - python3-pip
    - python3-dev
    - python-virtualenv
    - python3-virtualenv

- name: Install python wheel (allowed to fail)
  ignore_errors: yes
  apt: >
    name={{ item }} state=latest
  with_items:
    - python-wheel
    - python3-wheel

- name: Update APT package cache
  apt: update_cache=yes

- name: Install system packages
  apt: >
    name={{ item }} state=latest
  with_items:
    - sudo
    - python-software-properties
    - sqlite3
    - supervisor
    - nginx

- name: Install python2 packages
  when: openwisp2_python in ["python2.7", "python2"]
  apt: >
    name={{ item }} state=latest
  with_items:
    - python-pip
    - python-dev
    - python-virtualenv

- name: Install python3 packages
  when: openwisp2_python == "python3.4"
  apt: >
    name={{ item }} state=latest
  with_items:
    - python3
    - python3-pip
    - python3-dev
    - python-virtualenv
    - python3-virtualenv

- name: Install python wheel (allowed to fail)
  ignore_errors: yes
  apt: >
    name={{ item }} state=latest
  with_items:
    - python-wheel
    - python3-wheel

- name: Install git-core if using development version of any openwisp module
  apt: name=git state=latest
  when: not openwisp2_stable or not openwisp2_netjsonconfig_stable

Install git if using development version of any openwisp module
Install git if using development version of any openwisp module
