Move repo enablement to respective rpm blocks

Currently we are enabling repos irrespective of rpm/deb
statement blocks and not failing in the method used
if a repository is missing.

Downside is - we might be producing one more layer,
but it probably is a more logical approach.

This is required for adding rpm support in repos.yaml
that will also include failing on missing repositories.

Change-Id: I5479c5c935760f00fe4cd307366f261deee3199f
Signed-off-by: Michal Nasiadka <mnasiadka@gmail.com>
This commit is contained in:
Michal Nasiadka
2025-10-01 10:57:21 +02:00
parent d4b777bb06
commit 17727e1481
26 changed files with 78 additions and 37 deletions

View File

@@ -11,14 +11,15 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{{ macros.configure_user(name='bifrost') }} {{ macros.configure_user(name='bifrost') }}
{# NOTE(mgoddard): EPEL required for nginx #}
{{ macros.enable_extra_repos(['epel']) }}
{% set bifrost_base_packages = [ {% set bifrost_base_packages = [
'cpio' 'cpio'
] %} ] %}
{% if base_package_type == 'rpm' %} {% if base_package_type == 'rpm' %}
{# NOTE(mgoddard): EPEL required for nginx #}
{{ macros.enable_extra_repos(['epel']) }}
{% set bifrost_base_packages = bifrost_base_packages + [ {% set bifrost_base_packages = bifrost_base_packages + [
'python3.12', 'python3.12',
'python3.12-devel' 'python3.12-devel'

View File

@@ -9,9 +9,10 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{{ macros.configure_user(name='cinder') }} {{ macros.configure_user(name='cinder') }}
{% if base_package_type == 'rpm' %}
{{ macros.enable_extra_repos(['ceph', 'epel']) }} {{ macros.enable_extra_repos(['ceph', 'epel']) }}
{% if base_package_type == 'rpm' %}
{% set cinder_base_packages = [ {% set cinder_base_packages = [
'ceph-common', 'ceph-common',
'cryptsetup', 'cryptsetup',

View File

@@ -9,13 +9,14 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{{ macros.configure_user(name='collectd') }} {{ macros.configure_user(name='collectd') }}
{{ macros.enable_extra_repos(['opstools']) }}
{% set collectd_packages = [ {% set collectd_packages = [
'collectd' 'collectd'
] %} ] %}
{% if base_package_type == 'rpm' %} {% if base_package_type == 'rpm' %}
{{ macros.enable_extra_repos(['opstools']) }}
{% set collectd_packages = collectd_packages + [ {% set collectd_packages = collectd_packages + [
'collectd-amqp', 'collectd-amqp',
'collectd-amqp1', 'collectd-amqp1',

View File

@@ -9,9 +9,10 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{{ macros.configure_user(name='glance') }} {{ macros.configure_user(name='glance') }}
{% if base_package_type == 'rpm' %}
{{ macros.enable_extra_repos(['ceph', 'epel']) }} {{ macros.enable_extra_repos(['ceph', 'epel']) }}
{% if base_package_type == 'rpm' %}
{% set glance_base_packages = [ {% set glance_base_packages = [
'python3-rados', 'python3-rados',
'python3-rbd' 'python3-rbd'

View File

@@ -9,10 +9,10 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{{ macros.configure_user(name='gnocchi') }} {{ macros.configure_user(name='gnocchi') }}
{{ macros.enable_extra_repos(['ceph', 'epel']) }}
{% if base_package_type == 'rpm' %} {% if base_package_type == 'rpm' %}
{{ macros.enable_extra_repos(['ceph', 'epel']) }}
{% set gnocchi_base_packages = [ {% set gnocchi_base_packages = [
'librados2-devel', 'librados2-devel',
'python3-rados', 'python3-rados',

View File

@@ -7,8 +7,12 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% import "macros.j2" as macros with context %} {% import "macros.j2" as macros with context %}
{% if base_package_type =='rpm' %}
{{ macros.enable_extra_repos(['hacluster']) }} {{ macros.enable_extra_repos(['hacluster']) }}
{% endif %}
COPY extend_start.sh /usr/local/bin/kolla_extend_start COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 644 /usr/local/bin/kolla_extend_start RUN chmod 644 /usr/local/bin/kolla_extend_start

View File

@@ -7,9 +7,14 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% import "macros.j2" as macros with context %} {% import "macros.j2" as macros with context %}
{{ macros.enable_extra_repos(['openvswitch']) }}
{{ macros.configure_user(name='heat') }} {{ macros.configure_user(name='heat') }}
{% if base_package_type == 'rpm' %}
{{ macros.enable_extra_repos(['openvswitch']) }}
{% endif %}
{% set heat_base_packages = [ {% set heat_base_packages = [
] %} ] %}

View File

@@ -7,12 +7,13 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% import "macros.j2" as macros with context %} {% import "macros.j2" as macros with context %}
{# NOTE(mnasiadka): mod_auth_mellon missing in CentOS 10 Stream - temporarily from Kolla COPR #}
{{ macros.enable_extra_repos(['epel', 'kolla_el10']) }}
{{ macros.configure_user(name='keystone') }} {{ macros.configure_user(name='keystone') }}
{% if base_package_type == 'rpm' %} {% if base_package_type == 'rpm' %}
{# NOTE(mnasiadka): mod_auth_mellon missing in CentOS 10 Stream - temporarily from Kolla COPR #}
{{ macros.enable_extra_repos(['epel', 'kolla_el10']) }}
{% set keystone_base_packages = [ {% set keystone_base_packages = [
'cyrus-sasl-devel', 'cyrus-sasl-devel',
'mod_auth_mellon', 'mod_auth_mellon',

View File

@@ -13,7 +13,7 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{{ macros.configure_user(name='ansible') }} {{ macros.configure_user(name='ansible') }}
{{ macros.configure_user(name='rabbitmq') }} {{ macros.configure_user(name='rabbitmq') }}
{{ macros.enable_extra_repos(['crb', 'epel', 'erlang', 'openvswitch', 'rabbitmq']) }} {{ macros.enable_extra_repos(['erlang', 'rabbitmq']) }}
{% block rabbitmq_apt_preferences %} {% block rabbitmq_apt_preferences %}
{% if base_package_type == 'deb' %} {% if base_package_type == 'deb' %}
@@ -22,6 +22,9 @@ COPY apt_preferences_rabbitmq.{{ base_distro }} /etc/apt/preferences.d/rabbitmq
{% endblock %} {% endblock %}
{% if base_package_type == 'rpm' %} {% if base_package_type == 'rpm' %}
{{ macros.enable_extra_repos(['crb', 'epel', 'openvswitch']) }}
{% set kolla_toolbox_packages = [ {% set kolla_toolbox_packages = [
'erlang-27.*', 'erlang-27.*',
'gcc', 'gcc',

View File

@@ -7,10 +7,10 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% import "macros.j2" as macros with context %} {% import "macros.j2" as macros with context %}
{{ macros.enable_extra_repos(['openvswitch']) }}
{% if base_package_type == 'rpm' %} {% if base_package_type == 'rpm' %}
{{ macros.enable_extra_repos(['openvswitch']) }}
{% set kuryr_libnetwork_packages = [ {% set kuryr_libnetwork_packages = [
'openvswitch${KOLLA_RPM_OVS_VERSION}' 'openvswitch${KOLLA_RPM_OVS_VERSION}'
] %} ] %}

View File

@@ -7,11 +7,12 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% import "macros.j2" as macros with context %} {% import "macros.j2" as macros with context %}
{{ macros.enable_extra_repos(['openvswitch']) }}
{{ macros.configure_user(name='manila') }} {{ macros.configure_user(name='manila') }}
{% if base_package_type == 'rpm' %} {% if base_package_type == 'rpm' %}
{{ macros.enable_extra_repos(['openvswitch']) }}
{% set manila_base_packages = ['openvswitch${KOLLA_RPM_OVS_VERSION}'] %} {% set manila_base_packages = ['openvswitch${KOLLA_RPM_OVS_VERSION}'] %}
{% elif base_package_type == 'deb' %} {% elif base_package_type == 'deb' %}

View File

@@ -7,10 +7,11 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% import "macros.j2" as macros with context %} {% import "macros.j2" as macros with context %}
{% if base_package_type == 'rpm' %}
{# NOTE(mnasiadka): glusterfs-fuse missing in CentOS 10 Stream - temporarily from Kolla COPR #} {# NOTE(mnasiadka): glusterfs-fuse missing in CentOS 10 Stream - temporarily from Kolla COPR #}
{{ macros.enable_extra_repos(['ceph', 'epel', 'kolla_el10']) }} {{ macros.enable_extra_repos(['ceph', 'epel', 'kolla_el10']) }}
{% if base_package_type == 'rpm' %}
{% set manila_share_packages = [ {% set manila_share_packages = [
'ceph-common', 'ceph-common',
'sqlite', 'sqlite',

View File

@@ -9,11 +9,13 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{{ macros.configure_user(name='mysql') }} {{ macros.configure_user(name='mysql') }}
{# NOTE(mgoddard): EPEL required for pv package #}
{# NOTE(mnasiadka): Use AppStream version of MariaDB for now in CentOS #} {# NOTE(mnasiadka): Use AppStream version of MariaDB for now in CentOS #}
{{ macros.enable_extra_repos(['epel']) }}
{% if base_package_type == 'rpm' %} {% if base_package_type == 'rpm' %}
{# NOTE(mgoddard): EPEL required for pv package #}
{{ macros.enable_extra_repos(['epel']) }}
{% set mariadb_packages = [ {% set mariadb_packages = [
'expect', 'expect',
'mariadb-backup', 'mariadb-backup',

View File

@@ -7,10 +7,10 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% import "macros.j2" as macros with context %} {% import "macros.j2" as macros with context %}
{{ macros.enable_extra_repos(['hacluster']) }}
{% if base_package_type == 'rpm' %} {% if base_package_type == 'rpm' %}
{{ macros.enable_extra_repos(['hacluster']) }}
{% set masakari_monitors_packages = [ {% set masakari_monitors_packages = [
'cyrus-sasl-md5', 'cyrus-sasl-md5',
'cyrus-sasl-scram', 'cyrus-sasl-scram',

View File

@@ -7,11 +7,13 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% import "macros.j2" as macros with context %} {% import "macros.j2" as macros with context %}
{{ macros.enable_extra_repos(['docker-ce', 'openvswitch']) }} {{ macros.enable_extra_repos(['docker-ce']) }}
{{ macros.configure_user(name='neutron') }} {{ macros.configure_user(name='neutron') }}
{% if base_package_type == 'rpm' %} {% if base_package_type == 'rpm' %}
{{ macros.enable_extra_repos(['openvswitch']) }}
{% set neutron_base_packages = [ {% set neutron_base_packages = [
'conntrack-tools', 'conntrack-tools',
'dnsmasq', 'dnsmasq',

View File

@@ -7,11 +7,12 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% import "macros.j2" as macros with context %} {% import "macros.j2" as macros with context %}
{{ macros.enable_extra_repos(['openvswitch']) }}
{{ macros.configure_user(name='nova', groups='qemu') }} {{ macros.configure_user(name='nova', groups='qemu') }}
{% if base_package_type == 'rpm' %} {% if base_package_type == 'rpm' %}
{{ macros.enable_extra_repos(['openvswitch']) }}
{% set nova_base_packages = [ {% set nova_base_packages = [
'openvswitch${KOLLA_RPM_OVS_VERSION}', 'openvswitch${KOLLA_RPM_OVS_VERSION}',
'python3-openvswitch${KOLLA_RPM_OVS_VERSION}' 'python3-openvswitch${KOLLA_RPM_OVS_VERSION}'

View File

@@ -7,10 +7,10 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% import "macros.j2" as macros with context %} {% import "macros.j2" as macros with context %}
{{ macros.enable_extra_repos(['ceph', 'epel']) }}
{% if base_package_type == 'rpm' %} {% if base_package_type == 'rpm' %}
{{ macros.enable_extra_repos(['ceph', 'epel']) }}
{% set nova_compute_packages = [ {% set nova_compute_packages = [
'ceph-common', 'ceph-common',
'cyrus-sasl-md5', 'cyrus-sasl-md5',

View File

@@ -9,10 +9,10 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{{ macros.configure_user(name='nova', groups='qemu') }} {{ macros.configure_user(name='nova', groups='qemu') }}
{{ macros.enable_extra_repos(['ceph', 'crb', 'epel', 'openvswitch']) }}
{% if base_package_type == 'rpm' %} {% if base_package_type == 'rpm' %}
{{ macros.enable_extra_repos(['ceph', 'crb', 'epel', 'openvswitch']) }}
{% set nova_libvirt_packages = [ {% set nova_libvirt_packages = [
'ceph-common', 'ceph-common',
'cyrus-sasl-md5', 'cyrus-sasl-md5',

View File

@@ -7,11 +7,12 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% import "macros.j2" as macros with context %} {% import "macros.j2" as macros with context %}
{{ macros.enable_extra_repos(['openvswitch']) }}
{{ macros.configure_user(name='octavia') }} {{ macros.configure_user(name='octavia') }}
{% if base_package_type == 'rpm' %} {% if base_package_type == 'rpm' %}
{{ macros.enable_extra_repos(['openvswitch']) }}
{% set octavia_base_packages = [ {% set octavia_base_packages = [
'python3-openvswitch${KOLLA_RPM_OVS_VERSION}' 'python3-openvswitch${KOLLA_RPM_OVS_VERSION}'
] %} ] %}

View File

@@ -7,9 +7,10 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% import "macros.j2" as macros with context %} {% import "macros.j2" as macros with context %}
{% if base_package_type == 'rpm' %}
{{ macros.enable_extra_repos(['crb', 'epel']) }} {{ macros.enable_extra_repos(['crb', 'epel']) }}
{% if base_package_type == 'rpm' %}
{% set openstack_base_packages = [ {% set openstack_base_packages = [
'gcc', 'gcc',
'gcc-c++', 'gcc-c++',

View File

@@ -7,11 +7,12 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% import "macros.j2" as macros with context %} {% import "macros.j2" as macros with context %}
{{ macros.enable_extra_repos(['openvswitch']) }}
{% block ovs_install %} {% block ovs_install %}
{% if base_package_type == 'rpm' %} {% if base_package_type == 'rpm' %}
{{ macros.enable_extra_repos(['openvswitch']) }}
{% set openvswitch_base_packages = [ {% set openvswitch_base_packages = [
'libibverbs', 'libibverbs',
'openvswitch${KOLLA_RPM_OVS_VERSION}', 'openvswitch${KOLLA_RPM_OVS_VERSION}',

View File

@@ -9,7 +9,7 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{{ macros.configure_user(name='rabbitmq') }} {{ macros.configure_user(name='rabbitmq') }}
{{ macros.enable_extra_repos(['crb', 'erlang', 'rabbitmq']) }} {{ macros.enable_extra_repos(['erlang', 'rabbitmq']) }}
{% block rabbitmq_apt_preferences %} {% block rabbitmq_apt_preferences %}
{% if base_package_type == 'deb' %} {% if base_package_type == 'deb' %}
@@ -20,6 +20,8 @@ COPY apt_preferences_rabbitmq.{{ base_distro }} /etc/apt/preferences.d/rabbitmq
{% block rabbitmq_install %} {% block rabbitmq_install %}
{% if base_package_type == 'rpm' %} {% if base_package_type == 'rpm' %}
{{ macros.enable_extra_repos(['crb']) }}
{% set rabbitmq_packages = [ {% set rabbitmq_packages = [
'erlang-27.*', 'erlang-27.*',
'rabbitmq-server-4.1.*' 'rabbitmq-server-4.1.*'

View File

@@ -7,9 +7,14 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% import "macros.j2" as macros with context %} {% import "macros.j2" as macros with context %}
{{ macros.enable_extra_repos(['openvswitch']) }}
{{ macros.configure_user(name='tacker') }} {{ macros.configure_user(name='tacker') }}
{% if base_package_type == 'rpm' %}
{{ macros.enable_extra_repos(['openvswitch']) }}
{% endif %}
ADD tacker-base-archive /tacker-base-source ADD tacker-base-archive /tacker-base-source
ADD plugins-archive / ADD plugins-archive /

View File

@@ -7,10 +7,9 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% import "macros.j2" as macros with context %} {% import "macros.j2" as macros with context %}
{{ macros.enable_extra_repos(['influxdb']) }}
{{ macros.configure_user(name='telegraf', homedir='/etc/telegraf') }} {{ macros.configure_user(name='telegraf', homedir='/etc/telegraf') }}
{{ macros.enable_extra_repos(['influxdb', 'opstools']) }}
{% set telegraf_packages = [ {% set telegraf_packages = [
'chrony', 'chrony',
'net-tools', 'net-tools',
@@ -18,6 +17,9 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
] %} ] %}
{% if base_package_type == 'rpm' %} {% if base_package_type == 'rpm' %}
{{ macros.enable_extra_repos(['opstools']) }}
{% set telegraf_packages = telegraf_packages + [ {% set telegraf_packages = telegraf_packages + [
'collectd', 'collectd',
] %} ] %}

View File

@@ -7,11 +7,12 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% import "macros.j2" as macros with context %} {% import "macros.j2" as macros with context %}
{{ macros.enable_extra_repos(['openvswitch']) }}
{{ macros.configure_user(name='zun') }} {{ macros.configure_user(name='zun') }}
{% if base_package_type == 'rpm' %} {% if base_package_type == 'rpm' %}
{{ macros.enable_extra_repos(['openvswitch']) }}
{% set zun_base_packages = [ {% set zun_base_packages = [
'numactl', 'numactl',
] %} ] %}

View File

@@ -7,8 +7,12 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% import "macros.j2" as macros with context %} {% import "macros.j2" as macros with context %}
{% if base_package_type == 'rpm' %}
{{ macros.enable_extra_repos(['ceph', 'epel']) }} {{ macros.enable_extra_repos(['ceph', 'epel']) }}
{% endif %}
{% set zun_compute_packages = [ {% set zun_compute_packages = [
'ceph-common', 'ceph-common',
'e2fsprogs', 'e2fsprogs',