Files
kolla/tests/templates/template_overrides.j2
Michal Nasiadka 806602e488 Add support for rpm to repos.yaml
Add the ability to configure repositories in the same
way as we do Debuntu ones - via repos.yaml.

Removes .repo files from base - since these are not
needed there anymore.

gpgcheck = 1 is default in docker/base/dnf.conf

Change-Id: I7df7d452c45c57c434d5b4ad15a87963e4d6d0d4
Signed-off-by: Michal Nasiadka <mnasiadka@gmail.com>
2025-10-02 14:24:31 +02:00

81 lines
2.5 KiB
Django/Jinja

{% raw %}
{% extends parent_template %}
{% block base_pip_conf %}
{% endraw %}
ENV PIP_INDEX_URL {{ nodepool_pypi_mirror }}
ENV PIP_TRUSTED_HOST {{ nodepool_mirror_host }}
{% if use_infra_wheels_mirror | default(true) %}
ENV PIP_EXTRA_INDEX_URL {{ nodepool_wheel_mirror }}
{% endif %}
RUN echo registry={{ nodepool_npmjs_proxy }} > /etc/npmrc \
&& mkdir -p /usr/etc \
&& ln -s /etc/npmrc /usr/etc/npmrc
{% raw %}
{% endblock %}
{% endraw %}
{% if base_distro == 'rocky' %}
{% raw %}
{% block base_centos_repo_overrides_post_copy %}
{% endraw %}
RUN sed -i -e "s/^mirrorlist/#mirrorlist/g" -e "s/^#baseurl/baseurl/g" \
/etc/yum.repos.d/rocky.repo
{% raw %}
{% endblock %}
{% endraw %}
{% endif %}
{% raw %}
{% block base_debian_after_sources_list %}
{% endraw %}
{% if base_distro == "debian" %}
RUN sed -i -e "s|http://deb.debian.org|[trusted=yes] http://{{ nodepool_mirror_host }}|" \
-e "s|http://security.debian.org|[trusted=yes] http://{{ nodepool_mirror_host }}|" \
/etc/apt/sources.list
{% elif base_distro == "ubuntu" %}
RUN sed -i -e "s|mirror://mirrors.ubuntu.com/mirrors.txt|[trusted=yes] http://{{ nodepool_mirror_host }}/ubuntu/|" \
-e "s|http://ports.ubuntu.com|[trusted=yes] http://{{ nodepool_mirror_host }}/ubuntu-ports|" \
-e "s|http://ubuntu-cloud.archive.canonical.com/ubuntu|[trusted=yes] http://{{ nodepool_mirror_host }}/ubuntu-cloud-archive|" \
/etc/apt/sources.list
{% endif %}
{% raw %}
{% endblock %}
{# Revert to upstream mirrors after build is complete #}
{% block footer %}
{% endraw %}
ENV PIP_INDEX_URL=
ENV PIP_TRUSTED_HOST=
{% if use_infra_wheels_mirror | default(true) %}
ENV PIP_EXTRA_INDEX_URL=
{% endif %}
RUN if [ -f /usr/etc/npmrc ]; then \
unlink /usr/etc/npmrc; \
fi \
&& rm -f /etc/npmrc
{% if base_distro == "debian" %}
RUN sed -i -e "s|\[trusted=yes\] http://{{ nodepool_mirror_host }}|http://deb.debian.org|" \
-e "s|\[trusted=yes\] http://{{ nodepool_mirror_host }}|http://security.debian.org|" \
/etc/apt/sources.list
{% elif base_distro == "ubuntu" %}
RUN sed -i -e "s|\[trusted=yes\] http://{{ nodepool_mirror_host }}/ubuntu/|mirror://mirrors.ubuntu.com/mirrors.txt|" \
-e "s|\[trusted=yes\] http://{{ nodepool_mirror_host }}/ubuntu-cloud-archive|http://ubuntu-cloud.archive.canonical.com/ubuntu|" \
-e "s|\[trusted=yes\] http://{{ nodepool_mirror_host }}/ubuntu-ports|http://ports.ubuntu.com|" \
/etc/apt/sources.list
{% endif %}
{% raw %}
{% endblock %}
{% endraw %}