---
# This dummy resource ensures the python apt support is installed
# before we wipe the sources list in the next step
- name: Ensure python apt support is installed
  apt_repository:
    repo: deb http://dummy repo test
    state: absent

- name: Wipe existing sources.list
  copy:
    content: '# Sources are located in /etc/apt/sources.list.d'
    dest: /etc/apt/sources.list
    force: true

- name: Set up mirror
  apt_repository:
    repo: "{{ item }}"
    update_cache: true
  with_items: "{{ apt_repositories }}"

- name: Perform an apt update
  apt:
    update_cache: yes

- name: Perform a full upgrade
  apt:
    upgrade: dist
    dpkg_options: 'force-confold,force-confdef'
  when: nectar_test_build is not defined

---
# This dummy resource ensures the python apt support is installed
# before we wipe the sources list in the next step
- name: Ensure python apt support is installed
  apt_repository:
    repo: deb http://dummy repo test
    state: absent

- name: Wipe existing sources.list
  copy:
    content: '# Sources are located in /etc/apt/sources.list.d'
    dest: /etc/apt/sources.list
    force: true

- name: Set up mirror
  apt_repository:
    repo: "{{ item }}"
    filename: "{{ ansible_distribution|lower }}"
    update_cache: true
  with_items: "{{ apt_repositories }}"

- name: Perform an apt update
  apt:
    update_cache: yes

- name: Perform a full upgrade
  apt:
    upgrade: dist
    dpkg_options: 'force-confold,force-confdef'
  when: nectar_test_build is not defined

Set the main OS repo to have a nicer filename
Set the main OS repo to have a nicer filename

Rather than have 'au_archive_ubuntu_com_ubuntu.list', we'll have ubuntu.list
and Debian will have 'debian.list'

Change-Id: I809f7e2b8d1b0868908fee45995aaa42a47f5a34
