zuul-jobs/roles/configure-mirrors/tasks/mirror/Debian.yaml
Jonathan Rosser 5d01b68574 Allow some configure-mirrors repositories to be disabled
Out-of-the-box installs of centos-8 do not enable the PowerTools
or HighAvailability repositories. Debian/Ubuntu do not enable
the backports repository by default.

Having these repos enabled by default in CI has led to merging
broken code for OpenStack deployment tooling which is attempting
to also manage the presence/absence of these repositories. It
is challenging to remove these repositories on the running node
because the repo URL (rather than just the name) is required as
input to the apt_repository and yum_repository ansible modules.

This patch adds a role default variable to configure-mirrors to
allow a job to opt out of these extra repositories. The default
is set to 'True' to allow existing jobs to work as before.

Change-Id: I74b9de7092f182c942a58ac7a46b9fbd791889de
2022-02-16 20:39:31 +00:00

21 lines
615 B
YAML

- name: Install Debian repository files
become: yes
template:
dest: "/{{ zj_repo.repo }}"
group: root
mode: 0644
owner: root
src: "apt/{{ zj_repo.repo }}.j2"
with_items:
- repo: etc/apt/sources.list.d/default.list
- repo: etc/apt/sources.list.d/updates.list
- repo: etc/apt/sources.list.d/backports.list
condition: "{{ configure_mirrors_extra_repos }}"
- repo: etc/apt/sources.list.d/security.list
- repo: etc/apt/apt.conf.d/99unauthenticated
loop_control:
loop_var: zj_repo
when: zj_repo.condition | default(True) | bool
notify:
- Update apt cache