59 lines
2.3 KiB
YAML
59 lines
2.3 KiB
YAML
- name: Delete broken jessie-backports mirror http.debian.net/debian
|
|
lineinfile: dest=/etc/apt/sources.list
|
|
state=absent
|
|
regexp="{{ item }}"
|
|
with_items:
|
|
- '.*ftp.nl.debian.org\/debian\/ jessie-updates main$'
|
|
when: ansible_distribution == 'Debian' and ansible_distribution_release == 'jessie'
|
|
|
|
# So we use the copy module, using force=no to create a new empty file only when
|
|
# the file does not yet exist (if the file exists, its content is preserved).
|
|
- name: Make sure apt.conf exists
|
|
copy:
|
|
force: no
|
|
content: ""
|
|
dest: '/etc/apt/apt.conf'
|
|
owner: root
|
|
group: root
|
|
mode: 0744
|
|
|
|
- name: Ensure we disable apt Check-Valid-Until for jessie
|
|
lineinfile: dest=/etc/apt/apt.conf
|
|
state=present
|
|
regexp="^Acquire::Check-Valid-Until"
|
|
line='Acquire::Check-Valid-Until "false";'
|
|
when: ansible_distribution == 'Debian' and ansible_distribution_release == 'jessie'
|
|
|
|
- name: Ensure incorrect jessie backports and updates repositories are absent
|
|
apt_repository:
|
|
repo: "{{ item }}"
|
|
state: absent
|
|
with_items:
|
|
- "deb http://http.debian.net/debian jessie-backports main"
|
|
- "deb http://http.debian.net/debian jessie-updates main"
|
|
- "deb http://httpredir.debian.org/debian jessie-backports main"
|
|
- "deb http://httpredir.debian.org/debian jessie-updates main"
|
|
- "deb http://archive.debian.net/debian jessie-updates main"
|
|
- "deb http://archive.debian.net/debian jessie-backports main"
|
|
when: ansible_distribution == 'Debian' and ansible_distribution_release == 'jessie'
|
|
|
|
- name: Ensure archive.debian.org jessie-backport repositories are present
|
|
apt_repository:
|
|
repo: "{{ item }}"
|
|
state: present
|
|
with_items:
|
|
- "deb [check-valid-until=no] http://archive.debian.org/debian jessie-backports main"
|
|
- "deb-src [check-valid-until=no] http://archive.debian.org/debian jessie-backports main"
|
|
when: ansible_distribution == 'Debian' and ansible_distribution_release == 'jessie'
|
|
|
|
- name: Ensure backports repository is present for non jessie distro releases
|
|
apt_repository:
|
|
repo: "deb http://http.debian.net/debian {{ ansible_distribution_release }}-backports main"
|
|
state: present
|
|
when: ansible_distribution == 'Debian' and ansible_distribution_release != 'jessie'
|
|
|
|
- name: Test apt cache update
|
|
apt:
|
|
update_cache: yes
|
|
cache_valid_time: 900
|