|
80 | 80 | - { option: "name", value: "CentOS-{{ ansible_distribution_major_version }} - Extras" }
|
81 | 81 | - { option: "enabled", value: "1" }
|
82 | 82 | - { 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 %}" } |
84 | 84 | when:
|
85 | 85 | - use_oracle_public_repo | default(true)
|
86 | 86 | - '''ID="ol"'' in os_release.stdout_lines'
|
87 | 87 | - (ansible_distribution_version | float) >= 7.6
|
88 | 88 | - (ansible_distribution_version | float) < 9
|
89 | 89 |
|
| 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 | + |
90 | 110 | # CentOS ships with python installed
|
91 | 111 |
|
92 | 112 | - name: Check presence of fastestmirror.conf
|
|
0 commit comments