---

- name: Add Felix Krull's New Python Versions PPA to the apt sources list
  apt_repository: repo='ppa:fkrull/deadsnakes'
                  update_cache={{ update_apt_cache }}
                  state=present
  when: enable_deadsnakes_ppa

- name: Install additional packages
  apt: name={{ item }} update_cache={{ update_apt_cache }} state=installed
  with_items:
    - libav-tools
    - libcurl4-gnutls-dev
    - libgnutls-dev
    - libpq-dev
    - "{{ virtualenv_python_version + '-dev' }}"

---

- name: Add Felix Krull's New Python Versions PPA to the apt sources list
  apt_repository: repo='ppa:fkrull/deadsnakes'
                  update_cache={{ update_apt_cache }}
                  state=present
  when: enable_deadsnakes_ppa

- name: Install additional packages
  apt: name={{ item }} update_cache={{ update_apt_cache }} state=installed
  with_items:
    - libav-tools
    - libcurl4-gnutls-dev
    - gnutls-dev
    - libpq-dev
    - "{{ virtualenv_python_version + '-dev' }}"

Use gnutls-dev package name for compatibility across Ubuntu releases
Use gnutls-dev package name for compatibility across Ubuntu releases

This will install libgnutls26-dev or libgnutls28-dev as appropriate
in order to satisfy the build dependencies for pycurl installation
in the virtualenv (using pip). libgnutls-dev is dropped from newer
Ubuntu releases.
