@@ -317,12 +317,22 @@ kolla_build_blocks:
317
317
sed -i -e '/\[{{ repo.tag }}\]/,/^\[/ s/^\(mirrorlist *=.*\)/#\1/g' \
318
318
-e '/\[{{ repo.tag }}\]/,/^\[/ s/^[# ]*\(baseurl *=.*\)/#\1/g' \
319
319
-e '/\[{{ repo.tag }}\]/,/^\[/ s/^[# ]*\(metalink *=.*\)/#\1/g' \
320
+ {% if stackhpc_repo_mirror_username is truthy %}
321
+ -e '/\[{{ repo.tag }}\]/,/^\[/ s|^\(name.*\)|\1\nusername={{ stackhpc_repo_mirror_username }}|' \
322
+ -e '/\[{{ repo.tag }}\]/,/^\[/ s|^\(name.*\)|\1\npassword={{ stackhpc_repo_mirror_password }}|' \
323
+ {% endif %}
320
324
-e '/\[{{ repo.tag }}\]/,/^\[/ s|^\(name.*\)|\1\nbaseurl={{ repo.url }}|' /etc/yum.repos.d/{{ repo.file }}{% if not loop.last %} && \
321
325
{% endif %}
322
326
{% endfor %}
323
327
{% else %}
324
328
RUN \
325
329
rm /etc/apt/sources.list && \
330
+ rm -f /etc/apt/auth.conf && \
331
+ {% if stackhpc_repo_mirror_username is truthy %}
332
+ echo 'machine {{ stackhpc_repo_mirror_url }}' >> /etc/apt/auth.conf && \
333
+ echo 'login {{ stackhpc_repo_mirror_username }}' >> /etc/apt/auth.conf && \
334
+ echo 'password {{ stackhpc_repo_mirror_password }}' >> /etc/apt/auth.conf && \
335
+ {% endif %}
326
336
{% for repo in stackhpc_ubuntu_focal_base_repos %}
327
337
echo '{{ repo }}' >> /etc/apt/sources.list {% if not loop.last %} && \
328
338
{% endif %}
@@ -340,6 +350,10 @@ kolla_build_blocks:
340
350
sed -i -e '/\[{{ repo.tag }}\]/,/^\[/ s/^\(mirrorlist *=.*\)/#\1/g' \
341
351
-e '/\[{{ repo.tag }}\]/,/^\[/ s/^[# ]*\(baseurl *=.*\)/#\1/g' \
342
352
-e '/\[{{ repo.tag }}\]/,/^\[/ s/^[# ]*\(metalink *=.*\)/#\1/g' \
353
+ {% if stackhpc_repo_mirror_username is truthy %}
354
+ -e '/\[{{ repo.tag }}\]/,/^\[/ s|^\(name.*\)|\1\nusername={{ stackhpc_repo_mirror_username }}|' \
355
+ -e '/\[{{ repo.tag }}\]/,/^\[/ s|^\(name.*\)|\1\npassword={{ stackhpc_repo_mirror_password }}|' \
356
+ {% endif %}
343
357
-e '/\[{{ repo.tag }}\]/,/^\[/ s|^\(name.*\)|\1\nbaseurl={{ repo.url }}|' /etc/yum.repos.d/{{ repo.file }}{% if not loop.last %} &&{% endif %} \
344
358
{% endfor %}
345
359
{% endif %}
@@ -350,6 +364,12 @@ kolla_build_blocks:
350
364
{% endif %}
351
365
RUN \
352
366
rm /etc/apt/sources.list && \
367
+ rm -f /etc/apt/auth.conf && \
368
+ {% if stackhpc_repo_mirror_username is truthy %}
369
+ echo 'machine {{ stackhpc_repo_mirror_url }}' >> /etc/apt/auth.conf && \
370
+ echo 'login {{ stackhpc_repo_mirror_username }}' >> /etc/apt/auth.conf && \
371
+ echo 'password {{ stackhpc_repo_mirror_password }}' >> /etc/apt/auth.conf && \
372
+ {% endif %}
353
373
{% for repo in stackhpc_ubuntu_focal_repos %}
354
374
echo '{{ repo }}' >> /etc/apt/sources.list {% if not loop.last %} && \
355
375
{% endif %}
0 commit comments