diff options
| author | Michal Nasiadka <mnasiadka@gmail.com> | 2026-06-15 17:49:31 +0200 |
|---|---|---|
| committer | Michal Nasiadka <mnasiadka@gmail.com> | 2026-07-09 08:49:17 +0200 |
| commit | 77d310a9ff344a09f35b2c0536b0f7b9e8677deb (patch) | |
| tree | 59130fd2f762eb3d62f7e33cfa32d9edcf10265f /tests | |
| parent | 44b4d81399792f539716618953f2cafa64086a5c (diff) | |
| download | kolla-77d310a9ff344a09f35b2c0536b0f7b9e8677deb.tar.gz kolla-77d310a9ff344a09f35b2c0536b0f7b9e8677deb.zip | |
Add support to override base repos
BaseOS and AppStream for CentOS/Rocky
ubuntu, ubuntu-security for Ubuntu
debian, debian-security for Debian
ubuntu-cloud-archive is not really a base repo - so
removing it from ubuntu.sources
Change-Id: Iab98de963f2e8532389b7563bb572d8aa20c7aa6
Signed-off-by: Michal Nasiadka <mnasiadka@gmail.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/playbooks/run.yml | 10 | ||||
| -rw-r--r-- | tests/templates/repos.yaml.j2 | 63 | ||||
| -rw-r--r-- | tests/templates/template_overrides.j2 | 44 |
3 files changed, 74 insertions, 43 deletions
diff --git a/tests/playbooks/run.yml b/tests/playbooks/run.yml index ad3c80075..99791da0f 100644 --- a/tests/playbooks/run.yml +++ b/tests/playbooks/run.yml @@ -62,6 +62,16 @@ when: - not publisher + - name: Set up base repo overrides + vars: + kolla_repos_yaml_config: + DEFAULT: + repos_yaml: /etc/kolla/repos.yaml + ansible.builtin.set_fact: + kolla_build_config: "{{ kolla_build_config | combine(kolla_repos_yaml_config, recursive=True) }}" + kolla_build_repos_yaml_path: "{{ zuul.executor.work_root }}/{{ zuul.projects['opendev.org/openstack/kolla'].src_dir }}/tests/templates/repos.yaml.j2" + when: base_distro in ['debian', 'rocky', 'ubuntu'] + - name: Import kolla-build-config role import_role: name: kolla-build-config diff --git a/tests/templates/repos.yaml.j2 b/tests/templates/repos.yaml.j2 new file mode 100644 index 000000000..42c6724f9 --- /dev/null +++ b/tests/templates/repos.yaml.j2 @@ -0,0 +1,63 @@ +--- +{% if base_distro == 'debian' %} +debian: + debian: + component: "main" + gpg_key: "/usr/share/keyrings/debian-archive-keyring.gpg" + suite: "trixie trixie-updates trixie-backports" + trusted: True + url: "http://{{ nodepool_mirror_host }}/debian" + debian-security: + component: "main" + gpg_key: "/usr/share/keyrings/debian-archive-keyring.gpg" + suite: "trixie-security" + trusted: True + url: "http://{{ nodepool_mirror_host }}/debian-security" +{% elif base_distro == 'rocky' %} +rocky: + appstream: + baseurl: "http://dl.rockylinux.org/$contentdir/$releasever/AppStream/$basearch/os/" + gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-10" + name: "appstream" + baseos: + baseurl: "http://dl.rockylinux.org/$contentdir/$releasever/BaseOS/$basearch/os/" + gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-10" + name: "baseos" + crb: + baseurl: "http://dl.rockylinux.org/$contentdir/$releasever/CRB/$basearch/os/" + gpgkey: "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-10" + name: "crb" +{% elif base_distro == 'ubuntu' %} +ubuntu: + ubuntu: + component: "main universe" + gpg_key: "/usr/share/keyrings/ubuntu-archive-keyring.gpg" + suite: "noble noble-updates noble-backports" + trusted: True + url: "http://{{ nodepool_mirror_host }}/ubuntu/" + ubuntu-security: + component: "main universe" + gpg_key: "/usr/share/keyrings/ubuntu-archive-keyring.gpg" + suite: "noble-security" + trusted: True + url: "http://{{ nodepool_mirror_host }}/ubuntu/" + ubuntu-cloud-archive: + component: "main" + gpg_key: "/usr/share/keyrings/ubuntu-cloud-keyring.gpg" + suite: "noble-updates/gazpacho" + trusted: True + url: "http://{{ nodepool_mirror_host }}/ubuntu-cloud-archive" +ubuntu-aarch64: + ubuntu: + component: "main universe" + gpg_key: "/usr/share/keyrings/ubuntu-archive-keyring.gpg" + suite: "noble noble-updates noble-backports" + trusted: True + url: "http://{{ nodepool_mirror_host }}/ubuntu-ports/" + ubuntu-security: + component: "main universe" + gpg_key: "/usr/share/keyrings/ubuntu-archive-keyring.gpg" + suite: "noble-security" + trusted: True + url: "http://{{ nodepool_mirror_host }}/ubuntu-ports/" +{% endif %} diff --git a/tests/templates/template_overrides.j2 b/tests/templates/template_overrides.j2 index 481795cd6..cf34eb37f 100644 --- a/tests/templates/template_overrides.j2 +++ b/tests/templates/template_overrides.j2 @@ -18,42 +18,9 @@ RUN echo registry={{ nodepool_npmjs_proxy }} > /etc/npmrc \ {% 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 cp /etc/apt/sources.list.d/debian.sources /tmp/ && \ - sed -i -e "s|^URIs: http://deb.debian.org/debian$|URIs: http://{{ nodepool_mirror_host }}/debian\nTrusted: yes|" \ - -e "s|^URIs: http://deb.debian.org/debian-security|URIs: http://{{ nodepool_mirror_host }}/debian-security\nTrusted: yes|" \ - /etc/apt/sources.list.d/debian.sources - -{% elif base_distro == "ubuntu" %} - -RUN cp /etc/apt/sources.list.d/ubuntu.sources /tmp/ && \ - sed -i -e "s|^URIs: http://archive.ubuntu.com/ubuntu/$|URIs: http://{{ nodepool_mirror_host }}/ubuntu/\nTrusted: yes|" \ - -e "s|^URIs: http://security.ubuntu.com/ubuntu/$|URIs: http://{{ nodepool_mirror_host }}/ubuntu/\nTrusted: yes|" \ - -e "s|^URIs: http://ports.ubuntu.com/ubuntu-ports/$|URIs: http://{{ nodepool_mirror_host }}/ubuntu-ports/\nTrusted: yes|" \ - -e "s|^URIs: http://ubuntu-cloud.archive.canonical.com/ubuntu$|URIs: http://{{ nodepool_mirror_host }}/ubuntu-cloud-archive\nTrusted: yes|" \ - /etc/apt/sources.list.d/ubuntu.sources - -{% endif %} -{% raw %} -{% endblock %} - {# Revert to upstream mirrors after build is complete #} +{% raw %} {% block footer %} {% endraw %} @@ -67,15 +34,6 @@ RUN if [ -f /usr/etc/npmrc ]; then \ fi \ && rm -f /etc/npmrc -{% if base_distro == "debian" %} -RUN if [ -f /tmp/debian.sources ]; then \ - mv -f /tmp/debian.sources /etc/apt/sources.list.d/debian.sources; \ - fi -{% elif base_distro == "ubuntu" %} -RUN if [ -f /tmp/ubuntu.sources ]; then \ - mv -f /tmp/ubuntu.sources /etc/apt/sources.list.d/ubuntu.sources; \ - fi -{% endif %} {% raw %} {% endblock %} {% endraw %} |
