diff --git a/roles/configure-mirrors/README.rst b/roles/configure-mirrors/README.rst index 339219cb4..fd153cf4d 100644 --- a/roles/configure-mirrors/README.rst +++ b/roles/configure-mirrors/README.rst @@ -48,3 +48,11 @@ An ansible role to configure services to use mirrors. role is not necessarily consistent with the repos that are enabled by default between distribution versions (centos stream 8 vs. 9 for example). + +.. zuul:rolevar:: configure_mirrors_components_9_stream + :default: See `vars/CentOS-9.yaml` + + A list of the components that should be redirected to the + `mirror_fqdn` when setting up a CentOS 9-stream host. For example, + your mirror may only mirror some components, or not the + debug/source components, etc. diff --git a/roles/configure-mirrors/templates/centos9-stream/etc/yum.repos.d/centos-addons.repo.j2 b/roles/configure-mirrors/templates/centos9-stream/etc/yum.repos.d/centos-addons.repo.j2 index efc6ab31f..feb59d17b 100644 --- a/roles/configure-mirrors/templates/centos9-stream/etc/yum.repos.d/centos-addons.repo.j2 +++ b/roles/configure-mirrors/templates/centos9-stream/etc/yum.repos.d/centos-addons.repo.j2 @@ -1,6 +1,10 @@ [highavailability] name=CentOS Stream $releasever - HighAvailability +{% if configure_mirrors_components_9_stream['highavailability'] %} baseurl={{ package_mirror }}/$stream/HighAvailability/$basearch/os/ +{% else %} +metalink=https://mirrors.centos.org/metalink?repo=centos-highavailability-$stream&arch=$basearch&protocol=https,http +{% endif %} gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 @@ -10,7 +14,11 @@ enabled=0 [highavailability-debug] name=CentOS Stream $releasever - HighAvailability - Debug +{% if configure_mirrors_components_9_stream['highavailability-debug'] %} +baseurl={{ package_mirror }}/$stream/HighAvailability/%basearch/debug/ +{% else %} metalink=https://mirrors.centos.org/metalink?repo=centos-highavailability-debug-$stream&arch=$basearch&protocol=https,http +{% endif %} gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 @@ -19,7 +27,11 @@ enabled=0 [highavailability-source] name=CentOS Stream $releasever - HighAvailability - Source +{% if configure_mirrors_components_9_stream['highavailability-source'] %} +baseurl={{ package_mirror }}/$stream/HighAvailability/%basearch/source/ +{% else %} metalink=https://mirrors.centos.org/metalink?repo=centos-highavailability-source-$stream&arch=source&protocol=https,http +{% endif %} gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 @@ -28,7 +40,11 @@ enabled=0 [nfv] name=CentOS Stream $releasever - NFV +{% if configure_mirrors_components_9_stream['nfv'] %} baseurl={{ package_mirror }}/$stream/NFV/$basearch/os/ +{% else %} +metalink=https://mirrors.centos.org/metalink?repo=centos-nfv-$stream&arch=source&protocol=https,http +{% endif %} gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 @@ -38,7 +54,11 @@ enabled=0 [nfv-debug] name=CentOS Stream $releasever - NFV - Debug +{% if configure_mirrors_components_9_stream['nfv-debug'] %} +baseurl={{ package_mirror }}/$stream/NFV/$basearch/debug/ +{% else %} metalink=https://mirrors.centos.org/metalink?repo=centos-nfv-debug-$stream&arch=$basearch&protocol=https,http +{% endif %} gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 @@ -47,7 +67,11 @@ enabled=0 [nfv-source] name=CentOS Stream $releasever - NFV - Source +{% if configure_mirrors_components_9_stream['nfv-source'] %} +baseurl={{ package_mirror }}/$stream/NFV/$basearch/debug/ +{% else %} metalink=https://mirrors.centos.org/metalink?repo=centos-nfv-source-$stream&arch=source&protocol=https,http +{% endif %} gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 @@ -56,7 +80,11 @@ enabled=0 [rt] name=CentOS Stream $releasever - RT +{% if configure_mirrors_components_9_stream['rt'] %} baseurl={{ package_mirror }}/$stream/RT/$basearch/os/ +{% else %} +metalink=https://mirrors.centos.org/metalink?repo=centos-rt-$stream&arch=$basearch&protocol=https,http +{% endif %} gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 @@ -66,7 +94,11 @@ enabled=0 [rt-debug] name=CentOS Stream $releasever - RT - Debug +{% if configure_mirrors_components_9_stream['rt-debug'] %} +baseurl={{ package_mirror }}/$stream/RT/$basearch/debug/ +{% else %} metalink=https://mirrors.centos.org/metalink?repo=centos-rt-debug-$stream&arch=$basearch&protocol=https,http +{% endif %} gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 @@ -75,7 +107,11 @@ enabled=0 [rt-source] name=CentOS Stream $releasever - RT - Source +{% if configure_mirrors_components_9_stream['rt-source'] %} +baseurl={{ package_mirror }}/$stream/RT/$basearch/source/ +{% else %} metalink=https://mirrors.centos.org/metalink?repo=centos-rt-source-$stream&arch=source&protocol=https,http +{% endif %} gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 @@ -84,7 +120,11 @@ enabled=0 [resilientstorage] name=CentOS Stream $releasever - ResilientStorage +{% if configure_mirrors_components_9_stream['resilientstorage'] %} baseurl={{ package_mirror }}/$stream/ResilientStorage/$basearch/os/ +{% else %} +metalink=https://mirrors.centos.org/metalink?repo=centos-resilientstorage-$stream&arch=$basearch&protocol=https,http +{% endif %} gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 @@ -94,7 +134,11 @@ enabled=0 [resilientstorage-debug] name=CentOS Stream $releasever - ResilientStorage - Debug +{% if configure_mirrors_components_9_stream['resilientstorage-debug'] %} +baseurl={{ package_mirror }}/$stream/ResilientStorage/$basearch/debug/ +{% else %} metalink=https://mirrors.centos.org/metalink?repo=centos-resilientstorage-debug-$stream&arch=$basearch&protocol=https,http +{% endif %} gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 @@ -103,7 +147,11 @@ enabled=0 [resilientstorage-source] name=CentOS Stream $releasever - ResilientStorage - Source +{% if configure_mirrors_components_9_stream['resilientstorage-source'] %} +baseurl={{ package_mirror }}/$stream/ResilientStorage/$basearch/source/ +{% else %} metalink=https://mirrors.centos.org/metalink?repo=centos-resilientstorage-source-$stream&arch=source&protocol=https,http +{% endif %} gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 @@ -112,7 +160,11 @@ enabled=0 [extras-common] name=CentOS Stream $releasever - Extras packages +{% if configure_mirrors_components_9_stream['extras-common'] %} metalink=https://mirrors.centos.org/metalink?repo=centos-extras-sig-extras-common-$stream&arch=$basearch&protocol=https,http +{% else %} +baseurl={{ package_mirror }}/SIGs/$stream/extras/$basearch/extras-common/ +{% endif %} gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Extras-SHA512 gpgcheck=1 repo_gpgcheck=0 @@ -122,7 +174,11 @@ enabled=1 [extras-common-source] name=CentOS Stream $releasever - Extras packages - Source +{% if configure_mirrors_components_9_stream['extras-common'] %} +baseurl={{ package_mirror }}/SIGs/$stream/extras/source/extras-common/ +{% else %} metalink=https://mirrors.centos.org/metalink?repo=centos-extras-sig-extras-common-source-$stream&arch=source&protocol=https,http +{% endif %} gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Extras-SHA512 gpgcheck=1 repo_gpgcheck=0 diff --git a/roles/configure-mirrors/templates/centos9-stream/etc/yum.repos.d/centos.repo.j2 b/roles/configure-mirrors/templates/centos9-stream/etc/yum.repos.d/centos.repo.j2 index 7481d2890..8b446acb0 100644 --- a/roles/configure-mirrors/templates/centos9-stream/etc/yum.repos.d/centos.repo.j2 +++ b/roles/configure-mirrors/templates/centos9-stream/etc/yum.repos.d/centos.repo.j2 @@ -1,7 +1,11 @@ # {{ ansible_managed }} [baseos] name=CentOS Stream $releasever - BaseOS +{% if configure_mirrors_components_9_stream['baseos'] %} baseurl={{ package_mirror }}/$stream/BaseOS/$basearch/os/ +{% else %} +metalink=https://mirrors.centos.org/metalink?repo=centos-baseos-$stream&arch=$basearch&protocol=https,http +{% endif %} gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 @@ -11,7 +15,11 @@ enabled=1 [baseos-debug] name=CentOS Stream $releasever - BaseOS - Debug +{% if configure_mirrors_components_9_stream['baseos-debug'] %} +baseurl={{ package_mirror }}/$stream/BaseOS/$basearch/debug/ +{% else %} metalink=https://mirrors.centos.org/metalink?repo=centos-baseos-debug-$stream&arch=$basearch&protocol=https,http +{% endif %} gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 @@ -20,7 +28,11 @@ enabled=0 [baseos-source] name=CentOS Stream $releasever - BaseOS - Source +{% if configure_mirrors_components_9_stream['baseos-source'] %} +baseurl={{ package_mirror }}/$stream/BaseOS/$basearch/source/ +{% else %} metalink=https://mirrors.centos.org/metalink?repo=centos-baseos-source-$stream&arch=source&protocol=https,http +{% endif %} gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 @@ -29,7 +41,11 @@ enabled=0 [appstream] name=CentOS Stream $releasever - AppStream +{% if configure_mirrors_components_9_stream['appstream'] %} baseurl={{ package_mirror }}/$stream/AppStream/$basearch/os/ +{% else %} +metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-$stream&arch=$basearch&protocol=https,http +{% endif %} gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 @@ -39,7 +55,11 @@ enabled=1 [appstream-debug] name=CentOS Stream $releasever - AppStream - Debug +{% if configure_mirrors_components_9_stream['appstream-debug'] %} +baseurl={{ package_mirror }}/$stream/AppStream/$basearch/debug/ +{% else %} metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-debug-$stream&arch=$basearch&protocol=https,http +{% endif %} gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 @@ -48,7 +68,11 @@ enabled=0 [appstream-source] name=CentOS Stream $releasever - AppStream - Source +{% if configure_mirrors_components_9_stream['appstream-source'] %} +baseurl={{ package_mirror }}/$stream/AppStream/$basearch/source/ +{% else %} metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-source-$stream&arch=source&protocol=https,http +{% endif %} gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 @@ -57,7 +81,11 @@ enabled=0 [crb] name=CentOS Stream $releasever - CRB +{% if configure_mirrors_components_9_stream['crb'] %} baseurl={{ package_mirror }}/$stream/CRB/$basearch/os/ +{% else %} +metalink=https://mirrors.centos.org/metalink?repo=centos-crb-$stream&arch=$basearch&protocol=https,http +{% endif %} gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 @@ -67,7 +95,11 @@ enabled=1 [crb-debug] name=CentOS Stream $releasever - CRB - Debug +{% if configure_mirrors_components_9_stream['crb-debug'] %} +baseurl={{ package_mirror }}/$stream/CRB/$basearch/debug/ +{% else %} metalink=https://mirrors.centos.org/metalink?repo=centos-crb-debug-$stream&arch=$basearch&protocol=https,http +{% endif %} gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 @@ -76,7 +108,11 @@ enabled=0 [crb-source] name=CentOS Stream $releasever - CRB - Source +{% if configure_mirrors_components_9_stream['crb-source'] %} +baseurl={{ package_mirror }}/$stream/CRB/$basearch/source/ +{% else %} metalink=https://mirrors.centos.org/metalink?repo=centos-crb-source-$stream&arch=source&protocol=https,http +{% endif %} gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 diff --git a/roles/configure-mirrors/vars/CentOS-9.yaml b/roles/configure-mirrors/vars/CentOS-9.yaml index bf53ea80f..5002f44b4 100644 --- a/roles/configure-mirrors/vars/CentOS-9.yaml +++ b/roles/configure-mirrors/vars/CentOS-9.yaml @@ -1,3 +1,28 @@ package_mirror: "{{ http_or_https }}://{{ mirror_fqdn }}/{{ ansible_distribution | lower }}-stream" epel_mirror: "{{ http_or_https }}://{{ mirror_fqdn }}/epel" wheel_mirror: "{{ http_or_https }}://{{ mirror_fqdn }}/wheel/{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version }}-{{ ansible_architecture | lower }}" + +configure_mirrors_components_9_stream: + 'baseos': true + 'baseos-debug': false + 'baseos-source': false + 'appstream': true + 'appstream-debug': false + 'appstream-source': false + 'crb': true + 'crb-debug': false + 'crb-source': false + 'highavailability': true + 'highavailability-debug': false + 'highavailability-source': false + 'nfv': true + 'nfv-debug': true + 'nfv-source': false + 'rt': true + 'rt-debug': false + 'rt-source': false + 'resilientstorage': true + 'resilientstorage-debug': false + 'resilientstorage-source': false + 'extras-common': false + 'extras-common-source': false