Skip to content

Commit ee19b5b

Browse files
committed
Support credentials for custom DNF repositories
This allows us to use packages from authenticated repositories such as those on Ark. This patch depends on https://review.opendev.org/c/openstack/kayobe/+/908142/
1 parent e10923a commit ee19b5b

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

etc/kayobe/dnf.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,26 @@ dnf_custom_repos_el8:
6161
file: epel
6262
gpgkey: "{{ dnf_epel_8_gpg_key_url }}"
6363
gpgcheck: yes
64+
username: "{{ stackhpc_repo_mirror_username | default(omit, true) }}"
65+
password: "{{ stackhpc_repo_mirror_password | default(omit, true) }}"
6466
epel-modular:
6567
baseurl: "{{ stackhpc_repo_epel_modular_url }}"
6668
description: "Extra Packages for Enterprise Linux Modular $releasever - $basearch"
6769
enabled: "{{ dnf_enable_epel | bool }}"
6870
file: epel-modular
6971
gpgkey: "{{ dnf_epel_8_gpg_key_url }}"
7072
gpgcheck: yes
73+
username: "{{ stackhpc_repo_mirror_username | default(omit, true) }}"
74+
password: "{{ stackhpc_repo_mirror_password | default(omit, true) }}"
7175
docker:
7276
baseurl: "{{ stackhpc_repo_docker_url }}"
7377
description: "Package repository for installing docker"
7478
enabled: "{{ dnf_enable_docker | bool }}"
7579
file: docker
7680
gpgkey: "{{ dnf_docker_gpg_key_url }}"
7781
gpgcheck: yes
82+
username: "{{ stackhpc_repo_mirror_username | default(omit, true) }}"
83+
password: "{{ stackhpc_repo_mirror_password | default(omit, true) }}"
7884

7985
# CentOS Stream 8 specific repositories
8086
dnf_custom_repos_centos:
@@ -84,6 +90,8 @@ dnf_custom_repos_centos:
8490
file: CentOS-Stream-AppStream
8591
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
8692
gpgcheck: yes
93+
username: "{{ stackhpc_repo_mirror_username | default(omit, true) }}"
94+
password: "{{ stackhpc_repo_mirror_password | default(omit, true) }}"
8795
baseos:
8896
baseurl: "{{ stackhpc_repo_centos_stream_baseos_url }}"
8997
description: "CentOS Stream $releasever - BaseOS"
@@ -92,6 +100,8 @@ dnf_custom_repos_centos:
92100
gpgcheck: yes
93101
# Exclude buggy iptables: https://bugzilla.redhat.com/show_bug.cgi?id=2236501
94102
exclude: "iptables-1.8.5* iptables-libs-1.8.5* iptables-ebtables-1.8.5* iptables-services-1.8.5* iptables-arptables-1.8.5* iptables-devel-1.8.5*"
103+
username: "{{ stackhpc_repo_mirror_username | default(omit, true) }}"
104+
password: "{{ stackhpc_repo_mirror_password | default(omit, true) }}"
95105
extras:
96106
# This repo is no longer updated: https://www.spinics.net/lists/centos-devel/msg21454.html
97107
baseurl: "{{ stackhpc_repo_centos_stream_extras_url }}"
@@ -100,12 +110,16 @@ dnf_custom_repos_centos:
100110
enabled: false
101111
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
102112
gpgcheck: yes
113+
username: "{{ stackhpc_repo_mirror_username | default(omit, true) }}"
114+
password: "{{ stackhpc_repo_mirror_password | default(omit, true) }}"
103115
extras-common:
104116
baseurl: "{{ stackhpc_repo_centos_stream_extras_common_url }}"
105117
description: "CentOS Stream $releasever - Extras common Packages"
106118
file: CentOS-Stream-Extras-common
107119
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Extras
108120
gpgcheck: yes
121+
username: "{{ stackhpc_repo_mirror_username | default(omit, true) }}"
122+
password: "{{ stackhpc_repo_mirror_password | default(omit, true) }}"
109123

110124
# Rocky 8 specific repositories
111125
dnf_custom_repos_rocky:
@@ -115,18 +129,24 @@ dnf_custom_repos_rocky:
115129
file: "{{ 'Rocky-AppStream' if os_release == '8' else 'rocky' }}"
116130
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial
117131
gpgcheck: yes
132+
username: "{{ stackhpc_repo_mirror_username | default(omit, true) }}"
133+
password: "{{ stackhpc_repo_mirror_password | default(omit, true) }}"
118134
baseos:
119135
baseurl: "{{ stackhpc_repo_rocky_baseos_url }}"
120136
description: "Rocky Linux $releasever - BaseOS"
121137
file: "{{ 'Rocky-BaseOS' if os_release == '8' else 'rocky' }}"
122138
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial
123139
gpgcheck: yes
140+
username: "{{ stackhpc_repo_mirror_username | default(omit, true) }}"
141+
password: "{{ stackhpc_repo_mirror_password | default(omit, true) }}"
124142
extras:
125143
baseurl: "{{ stackhpc_repo_rocky_extras_url }}"
126144
description: "Rocky Linux $releasever - Extras"
127145
file: "{{ 'Rocky-Extras' if os_release == '8' else 'rocky-extras' }}"
128146
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial
129147
gpgcheck: yes
148+
username: "{{ stackhpc_repo_mirror_username | default(omit, true) }}"
149+
password: "{{ stackhpc_repo_mirror_password | default(omit, true) }}"
130150

131151
# Custom repositories shared between all RHEL 9 derivatives.
132152
dnf_custom_repos_el9:
@@ -137,13 +157,17 @@ dnf_custom_repos_el9:
137157
file: epel
138158
gpgkey: "{{ dnf_epel_9_gpg_key_url }}"
139159
gpgcheck: yes
160+
username: "{{ stackhpc_repo_mirror_username | default(omit, true) }}"
161+
password: "{{ stackhpc_repo_mirror_password | default(omit, true) }}"
140162
docker:
141163
baseurl: "{{ stackhpc_repo_centos_stream_9_docker_url }}"
142164
description: "Package repository for installing docker"
143165
enabled: "{{ dnf_enable_docker | bool }}"
144166
file: docker
145167
gpgkey: "{{ dnf_docker_gpg_key_url }}"
146168
gpgcheck: yes
169+
username: "{{ stackhpc_repo_mirror_username | default(omit, true) }}"
170+
password: "{{ stackhpc_repo_mirror_password | default(omit, true) }}"
147171

148172
# ELRepo 9
149173
dnf_custom_repos_elrepo_9:
@@ -154,6 +178,8 @@ dnf_custom_repos_elrepo_9:
154178
file: elrepo
155179
gpgkey: https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
156180
gpgcheck: yes
181+
username: "{{ stackhpc_repo_mirror_username | default(omit, true) }}"
182+
password: "{{ stackhpc_repo_mirror_password | default(omit, true) }}"
157183

158184
# Rocky 9 specific repositories
159185
dnf_custom_repos_rocky_9:
@@ -163,24 +189,32 @@ dnf_custom_repos_rocky_9:
163189
file: rocky
164190
gpgkey: "{{ rocky_9_gpg_key }}"
165191
gpgcheck: yes
192+
username: "{{ stackhpc_repo_mirror_username | default(omit, true) }}"
193+
password: "{{ stackhpc_repo_mirror_password | default(omit, true) }}"
166194
baseos:
167195
baseurl: "{{ stackhpc_repo_rocky_9_baseos_url }}"
168196
description: "Rocky Linux $releasever - BaseOS"
169197
file: rocky
170198
gpgkey: "{{ rocky_9_gpg_key }}"
171199
gpgcheck: yes
200+
username: "{{ stackhpc_repo_mirror_username | default(omit, true) }}"
201+
password: "{{ stackhpc_repo_mirror_password | default(omit, true) }}"
172202
crb:
173203
baseurl: "{{ stackhpc_repo_rocky_9_crb_url }}"
174204
description: "Rocky Linux $releasever - CRB"
175205
file: rocky
176206
gpgkey: "{{ rocky_9_gpg_key }}"
177207
gpgcheck: yes
208+
username: "{{ stackhpc_repo_mirror_username | default(omit, true) }}"
209+
password: "{{ stackhpc_repo_mirror_password | default(omit, true) }}"
178210
extras:
179211
baseurl: "{{ stackhpc_repo_rocky_9_extras_url }}"
180212
description: "Rocky Linux $releasever - Extras"
181213
file: rocky-extras
182214
gpgkey: "{{ rocky_9_gpg_key }}"
183215
gpgcheck: yes
216+
username: "{{ stackhpc_repo_mirror_username | default(omit, true) }}"
217+
password: "{{ stackhpc_repo_mirror_password | default(omit, true) }}"
184218

185219
# Whether to enable EPEL repositories. This affects RedHat-based systems only.
186220
dnf_enable_epel: "{{ dnf_install_epel | bool }}"

etc/kayobe/stackhpc.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
# Host and port of a package repository mirror.
33
stackhpc_repo_mirror_url: "{{ pulp_url }}"
44

5+
# Username of a package repository mirror.
6+
stackhpc_repo_mirror_username:
7+
8+
# Password of a package repository mirror.
9+
stackhpc_repo_mirror_password:
10+
511
# Distribution name. Either 'development' or 'production'.
612
stackhpc_repo_distribution: "development"
713

0 commit comments

Comments
 (0)