Enable deb-src on Debian with a flag in configure-mirrors

This enables deb-src repos on Debian hosts with a flag. The flag
currently defaults to True to maintain backward compatible behavior with
the hardcoded deb-src repos that configure-mirrors previously set. We
intend on flipping this default to False after announcing this change.

The reasons for this are that source package repos are rarely needed
by CI systems, but these repos can consume large amounts of disk in
mirrors. To make it easier to people deploying mirrors we want to avoid
enabling source repos by default.

Change-Id: I7e9cd0ec1e3184c3c0561bbb7d3069feaf5f1ba5
This commit is contained in:
Clark Boylan 2022-04-27 09:11:08 -07:00
parent 775729a4c0
commit fc133bd165
6 changed files with 18 additions and 1 deletions
roles/configure-mirrors

@ -31,7 +31,15 @@ An ansible role to configure services to use mirrors.
when accessing unsigned mirrors with newer releases like
Ubuntu Bionic.
-- zuul:rolevar:: configure_mirrors_extra_repos
.. zuul:rolevar:: enable_deb_src_repos
:default: True
Set this to True in order to enable deb-src entries in sources.list
configs for apt. Note this option currently only works on Debian
(not Ubuntu) installations and will be set to default to False in
the near future.
.. zuul:rolevar:: configure_mirrors_extra_repos
:default: True
Set to False to opt-out of installing extra repositories such

@ -10,4 +10,5 @@ http_or_https: >-
{%- endif -%}
pypi_mirror: "{{ http_or_https }}://{{ pypi_fqdn }}/pypi/simple"
wheel_mirror: "{{ http_or_https }}://{{ mirror_fqdn }}/wheel/{{ ansible_distribution | lower }}-{{ ansible_distribution_version }}-{{ ansible_architecture | lower }}"
enable_deb_src_repos: True
configure_mirrors_extra_repos: True

@ -1,3 +1,5 @@
# {{ ansible_managed }}
deb {{ package_mirror }} {{ ansible_distribution_release }}-backports main
{% if enable_deb_src_repos | bool -%}
deb-src {{ package_mirror }} {{ ansible_distribution_release }}-backports main
{% endif -%}

@ -1,3 +1,5 @@
# {{ ansible_managed }}
deb {{ package_mirror }} {{ ansible_distribution_release }} main
{% if enable_deb_src_repos | bool -%}
deb-src {{ package_mirror }} {{ ansible_distribution_release }} main
{% endif -%}

@ -1,3 +1,5 @@
# {{ ansible_managed }}
deb {{ security_mirror }} {{ ansible_distribution_release }}{% if ansible_distribution_release not in ['jessie', 'stretch', 'buster'] %}-security{% endif %} main
{% if enable_deb_src_repos | bool -%}
deb-src {{ security_mirror }} {{ ansible_distribution_release }}{% if ansible_distribution_release not in ['jessie', 'stretch', 'buster'] %}-security{% endif %} main
{% endif -%}

@ -1,3 +1,5 @@
# {{ ansible_managed }}
deb {{ package_mirror }} {{ ansible_distribution_release }}-updates main
{% if enable_deb_src_repos | bool -%}
deb-src {{ package_mirror }} {{ ansible_distribution_release }}-updates main
{% endif -%}