@@ -217,14 +217,20 @@ stackhpc_epel_9_repos:
217217base_centos_repo_overrides_post_yum_list : " {{ stackhpc_rocky_9_repos + stackhpc_epel_9_repos + stackhpc_rocky_9_additional_repos + stackhpc_rocky_9_third_party_repos }}"
218218stackhpc_yum_repos : " {{ stackhpc_rocky_9_repos }}"
219219
220- # List of repositories for Ubuntu Jammy.
221- stackhpc_ubuntu_jammy_repos :
220+ # List of base repositories for Ubuntu Jammy.
221+ stackhpc_ubuntu_jammy_base_repos :
222222 - " deb {{ stackhpc_repo_ubuntu_jammy_url }} jammy main universe"
223223 - " deb {{ stackhpc_repo_ubuntu_jammy_url }} jammy-updates main universe"
224224 - " deb {{ stackhpc_repo_ubuntu_jammy_url }} jammy-backports main universe"
225225 - " deb {{ stackhpc_repo_ubuntu_jammy_security_url }} jammy-security main universe"
226+
227+ # List of UCA repositories for Ubuntu Jammy.
228+ stackhpc_ubuntu_jammy_uca_repos :
226229 - " deb {{ stackhpc_repo_ubuntu_cloud_archive_url }} jammy-updates/{{ openstack_release }} main"
227230
231+ # List of repositories for Ubuntu Jammy.
232+ stackhpc_ubuntu_jammy_repos : " {{ stackhpc_ubuntu_jammy_base_repos + stackhpc_ubuntu_jammy_uca_repos }}"
233+
228234# Whether to revert to the upstream mirrors in built Kolla container images.
229235stackhpc_kolla_clean_up_repo_mirrors : true
230236
@@ -244,6 +250,13 @@ kolla_build_blocks:
244250 -e '/\[{{ repo.tag }}\]/,/^\[/ s|^\(name.*\)|\1\nbaseurl={{ repo.url }}|' /etc/yum.repos.d/{{ repo.file }}{% if not loop.last %} && \
245251 {% endif %}
246252 {% endfor %}
253+ {% else %}
254+ RUN \
255+ rm /etc/apt/sources.list && \
256+ {% for repo in stackhpc_ubuntu_jammy_base_repos %}
257+ echo '{{ repo }}' >> /etc/apt/sources.list {% if not loop.last %} && \
258+ {% endif %}
259+ {% endfor %}
247260 {% endif %}
248261 base_centos_repo_overrides_post_yum : |
249262 {# fixme #}
@@ -260,9 +273,13 @@ kolla_build_blocks:
260273 -e '/\[{{ repo.tag }}\]/,/^\[/ s|^\(name.*\)|\1\nbaseurl={{ repo.url }}|' /etc/yum.repos.d/{{ repo.file }}{% if not loop.last %} &&{% endif %} \
261274 {% endfor %}
262275 {% endif %}
276+ # With the UCA keyring installed we can now add all repos.
263277 base_ubuntu_package_sources_list : |
278+ {% if stackhpc_kolla_clean_up_repo_mirrors | bool %}
279+ COPY sources.list.ubuntu /etc/apt/sources.list.backup
280+ {% endif %}
264281 RUN \
265- mv /etc/apt/sources.list /etc/apt/sources.list.backup && \
282+ rm /etc/apt/sources.list && \
266283 {% for repo in stackhpc_ubuntu_jammy_repos %}
267284 echo '{{ repo }}' >> /etc/apt/sources.list {% if not loop.last %} && \
268285 {% endif %}
0 commit comments