---

- hosts: all
  sudo: true
  vars:
    git_install_from_source: true
    git_install_from_source_force_update: true
    git_version: 2.9.3
    curl_configure_flags:
      - disable-shared
      - with-ssl
    install_ivm: true
    install_iojs: true
    node_version: 7.9.0
    node_versions:
      - 1.0.0
      - 2.0.0
      - 3.0.0
      - 4.0.0
      - 5.0.0
      - 6.0.0
      - 7.0.0
    node_packages:
      - grunt
  tasks:
    - name: Install dependencies.
      package:
        name:: "{{ item }}"
        state: installed
      with_items:
        - curl
        - git
        - git-svn
        - rsync
        - openssh-server
        - openssh-client
        - python
        - python-dev
        - unzip
        - tar
        - gtar
        - gzip
        - wget
        - gettext-devel
        - expat-devel
        - curl-devel
        - zlib-devel
        - perl-devel
        - openssl-devel
        - subversion-perl
        - make
        - libcurl4-gnutls-dev
        - libexpat1-dev
        - gettext
        - libssl-dev
        - build-essential
        - zip
        - sudo
      failed_when: false
  roles:
    - geerlingguy.git
    - fubarhouse.curl
    - role_under_test

---

- hosts: all
  sudo: true
  vars:
    git_install_from_source: true
    git_install_from_source_force_update: true
    git_version: 2.9.3
    curl_configure_flags:
      - disable-shared
      - with-ssl
    install_ivm: true
    install_iojs: true
    node_version: 7.9.0
    node_versions:
      - 1.0.0
      - 2.0.0
      - 3.0.0
      - 4.0.0
      - 5.0.0
      - 6.0.0
      - 7.0.0
    node_packages:
      - grunt
  pre_tasks:
    - name: Update apt cache.
      apt:
        update_cache: yes
        cache_valid_time: 600
      when: ansible_os_family == 'Debian'
      changed_when: false
      failed_when: false
  tasks:
    - name: Install dependencies.
      package:
        name:: "{{ item }}"
        state: installed
      with_items:
        - curl
        - git
        - git-svn
        - rsync
        - openssh-server
        - openssh-client
        - python
        - python-dev
        - unzip
        - tar
        - gtar
        - gzip
        - wget
        - gettext-devel
        - expat-devel
        - curl-devel
        - zlib-devel
        - perl-devel
        - openssl-devel
        - subversion-perl
        - make
        - libcurl4-gnutls-dev
        - libexpat1-dev
        - gettext
        - libssl-dev
        - build-essential
        - zip
        - sudo
      failed_when: false
  roles:
    - geerlingguy.git
    - fubarhouse.curl
    - role_under_test

Add pre_task to clear apt cache
Add pre_task to clear apt cache

