diff --git a/roles/configure-mirrors/README.rst b/roles/configure-mirrors/README.rst index f1996da0b..4359993b5 100644 --- a/roles/configure-mirrors/README.rst +++ b/roles/configure-mirrors/README.rst @@ -11,3 +11,10 @@ An ansible role to configure services to use mirrors. URL to override the generated pypi mirror url based on :zuul:rolevar:`configure-mirrors.mirror_fqdn`. + +.. zuul:rolevar:: set_apt_mirrors_trusted + :default: False + + Set to True in order to tag APT mirrors as trusted, needed + when accessing unsigned mirrors with newer releases like + Ubuntu Bionic. diff --git a/roles/configure-mirrors/defaults/main.yaml b/roles/configure-mirrors/defaults/main.yaml index af4c7b109..fc2bd7ce5 100644 --- a/roles/configure-mirrors/defaults/main.yaml +++ b/roles/configure-mirrors/defaults/main.yaml @@ -1,3 +1,4 @@ mirror_fqdn: "{{ zuul_site_mirror_fqdn|default(omit) }}" pypi_mirror: "http://{{ mirror_fqdn }}/pypi/simple" +set_apt_mirrors_trusted: False wheel_mirror: "http://{{ mirror_fqdn }}/wheel/{{ ansible_distribution | lower }}-{{ ansible_distribution_version }}-{{ ansible_architecture | lower }}" diff --git a/roles/configure-mirrors/templates/etc/apt/sources.list.j2 b/roles/configure-mirrors/templates/etc/apt/sources.list.j2 index cfff12d69..8461d4046 100644 --- a/roles/configure-mirrors/templates/etc/apt/sources.list.j2 +++ b/roles/configure-mirrors/templates/etc/apt/sources.list.j2 @@ -1,5 +1,5 @@ # {{ ansible_managed }} -deb {{ package_mirror }} {{ ansible_distribution_release }} main universe -deb {{ package_mirror }} {{ ansible_distribution_release }}-updates main universe -deb {{ package_mirror }} {{ ansible_distribution_release }}-backports main universe -deb {{ package_mirror }} {{ ansible_distribution_release }}-security main universe +deb {% if set_apt_mirrors_trusted %}[ trusted=yes ] {% endif %}{{ package_mirror }} {{ ansible_distribution_release }} main universe +deb {% if set_apt_mirrors_trusted %}[ trusted=yes ] {% endif %}{{ package_mirror }} {{ ansible_distribution_release }}-updates main universe +deb {% if set_apt_mirrors_trusted %}[ trusted=yes ] {% endif %}{{ package_mirror }} {{ ansible_distribution_release }}-backports main universe +deb {% if set_apt_mirrors_trusted %}[ trusted=yes ] {% endif %}{{ package_mirror }} {{ ansible_distribution_release }}-security main universe