Skip to content

Commit 1601b0d

Browse files
Feat: Update CentOS 7 EOL package to vault.centos.org (#11364)
Signed-off-by: tico88612 <[email protected]> Co-authored-by: tico88612 <[email protected]>
1 parent 73a511b commit 1601b0d

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

roles/bootstrap-os/tasks/bootstrap-centos.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,33 @@
8080
- { option: "name", value: "CentOS-{{ ansible_distribution_major_version }} - Extras" }
8181
- { option: "enabled", value: "1" }
8282
- { option: "gpgcheck", value: "0" }
83-
- { option: "baseurl", value: "http://mirror.centos.org/{{ 'altarch' if (ansible_distribution_major_version | int) <= 7 and ansible_architecture == 'aarch64' else 'centos' }}/{{ ansible_distribution_major_version }}/extras/$basearch/{% if ansible_distribution_major_version | int > 7 %}os/{% endif %}" }
83+
- { option: "baseurl", value: "http://vault.centos.org/{{ 'altarch' if (ansible_distribution_major_version | int) <= 7 and ansible_architecture == 'aarch64' else 'centos' }}/{{ ansible_distribution_major_version }}/extras/$basearch/{% if ansible_distribution_major_version | int > 7 %}os/{% endif %}" }
8484
when:
8585
- use_oracle_public_repo | default(true)
8686
- '''ID="ol"'' in os_release.stdout_lines'
8787
- (ansible_distribution_version | float) >= 7.6
8888
- (ansible_distribution_version | float) < 9
8989

90+
# CentOS 7 EOL at July 1, 2024.
91+
- name: Disable CentOS 7 mirrorlist in CentOS-Base.repo
92+
replace:
93+
path: /etc/yum.repos.d/CentOS-Base.repo
94+
regexp: '^mirrorlist='
95+
replace: '#mirrorlist='
96+
become: true
97+
when:
98+
- ansible_distribution_major_version == "7"
99+
100+
# CentOS 7 EOL at July 1, 2024.
101+
- name: Update CentOS 7 baseurl in CentOS-Base.repo
102+
replace:
103+
path: /etc/yum.repos.d/CentOS-Base.repo
104+
regexp: '^#baseurl=http:\/\/mirror.centos.org'
105+
replace: 'baseurl=http:\/\/vault.centos.org'
106+
become: true
107+
when:
108+
- ansible_distribution_major_version == "7"
109+
90110
# CentOS ships with python installed
91111

92112
- name: Check presence of fastestmirror.conf

0 commit comments

Comments
 (0)