---

- name: ubuntu apt repo sources list
  when:
    - not offline_mode | d(false)
    - ansible_distribution == 'Ubuntu'
  notify: update cache
  copy:
    dest: /etc/apt/sources.list
    content: |
      deb {{ repos_prefix }}archive.ubuntu.com/ubuntu/ {{ repos_release }} main restricted universe multiverse
      deb {{ repos_prefix }}archive.ubuntu.com/ubuntu/ {{ repos_release }}-updates main restricted universe multiverse
      deb {{ repos_prefix }}archive.ubuntu.com/ubuntu/ {{ repos_release }}-backports main restricted universe multiverse
      deb {{ repos_prefix }}security.ubuntu.com/ubuntu {{ repos_release }}-security main restricted universe multiverse


- name: debian apt repo sources list
  when:
    - not offline_mode | d(false)
    - ansible_distribution == 'Debian'
  notify: update cache
  copy:
    dest: /etc/apt/sources.list
    content: |
      deb {{ repos_prefix }}{{ repos_deb }}/debian {{ repos_release }} main contrib non-free
      deb {{ repos_prefix }}{{ repos_deb }}/debian {{ repos_release }}-updates main contrib non-free
      deb {{ repos_prefix }}{{ repos_deb_sec }}/debian-security {{ repos_release }}/updates main contrib non-free

- name: add ubicast apt repo key
  when: not offline_mode | d(false)
  apt_key:
    url: https://{{ repos_skyreach_host }}/media/public.gpg

- name: add ubicast apt repo
  when:
    - not offline_mode | d(false)
    - repos_skyreach_token | d(false)
  apt_repository:
    repo: deb https://{{ repos_skyreach_host }} packaging/apt/{{ repos_skyreach_token }}/
    filename: ubicast
    update_cache: true

- name: add ubicast security apt repo
  when: not offline_mode | d(false)
  apt_repository:
    repo: deb https://{{ repos_skyreach_host }} packaging/apt/ubicast-security-updates/
    filename: ubicast-secu
    update_cache: true

...
