From 1601b0db5781809f81824719d10348eee800c8a4 Mon Sep 17 00:00:00 2001 From: k8s-infra-cherrypick-robot <90416843+k8s-infra-cherrypick-robot@users.noreply.github.com> Date: Thu, 11 Jul 2024 01:41:23 -0700 Subject: [PATCH] Feat: Update CentOS 7 EOL package to vault.centos.org (#11364) Signed-off-by: tico88612 <17496418+tico88612@users.noreply.github.com> Co-authored-by: tico88612 <17496418+tico88612@users.noreply.github.com> --- roles/bootstrap-os/tasks/bootstrap-centos.yml | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/roles/bootstrap-os/tasks/bootstrap-centos.yml b/roles/bootstrap-os/tasks/bootstrap-centos.yml index 5d543aea12f..fcd20d562ea 100644 --- a/roles/bootstrap-os/tasks/bootstrap-centos.yml +++ b/roles/bootstrap-os/tasks/bootstrap-centos.yml @@ -80,13 +80,33 @@ - { option: "name", value: "CentOS-{{ ansible_distribution_major_version }} - Extras" } - { option: "enabled", value: "1" } - { option: "gpgcheck", value: "0" } - - { 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 %}" } + - { 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 %}" } when: - use_oracle_public_repo | default(true) - '''ID="ol"'' in os_release.stdout_lines' - (ansible_distribution_version | float) >= 7.6 - (ansible_distribution_version | float) < 9 +# CentOS 7 EOL at July 1, 2024. +- name: Disable CentOS 7 mirrorlist in CentOS-Base.repo + replace: + path: /etc/yum.repos.d/CentOS-Base.repo + regexp: '^mirrorlist=' + replace: '#mirrorlist=' + become: true + when: + - ansible_distribution_major_version == "7" + +# CentOS 7 EOL at July 1, 2024. +- name: Update CentOS 7 baseurl in CentOS-Base.repo + replace: + path: /etc/yum.repos.d/CentOS-Base.repo + regexp: '^#baseurl=http:\/\/mirror.centos.org' + replace: 'baseurl=http:\/\/vault.centos.org' + become: true + when: + - ansible_distribution_major_version == "7" + # CentOS ships with python installed - name: Check presence of fastestmirror.conf