mirror of https://github.com/ceph/ceph-ansible.git
tests/setup: Use local mirror of centos 8 stream repo
The mirrors provided by CentOS' mirrorlists are super slow Signed-off-by: David Galloway <dgallowa@redhat.com>subset-debug-master
parent
c5bb450f87
commit
1c740c424a
|
@ -13,6 +13,51 @@
|
||||||
set_fact:
|
set_fact:
|
||||||
is_atomic: '{{ stat_ostree.stat.exists }}'
|
is_atomic: '{{ stat_ostree.stat.exists }}'
|
||||||
|
|
||||||
|
- name: List repo files
|
||||||
|
find:
|
||||||
|
paths: /etc/yum.repos.d/
|
||||||
|
file_type: file
|
||||||
|
patterns: 'CentOS-Stream-*.repo'
|
||||||
|
register: pre_stream_repo_files
|
||||||
|
when:
|
||||||
|
- ansible_facts['distribution'] == 'CentOS'
|
||||||
|
- ansible_facts['distribution_major_version'] | int > 7
|
||||||
|
- not is_atomic | bool
|
||||||
|
|
||||||
|
# From ansible docs: 'replace: If not set, matches are removed entirely.'
|
||||||
|
- name: Remove all mirrorlists
|
||||||
|
replace:
|
||||||
|
path: "{{ item.path }}"
|
||||||
|
regexp: '^mirrorlist=.*'
|
||||||
|
with_items: "{{ pre_stream_repo_files.files }}"
|
||||||
|
when:
|
||||||
|
- ansible_facts['distribution'] == 'CentOS'
|
||||||
|
- ansible_facts['distribution_major_version'] | int > 7
|
||||||
|
- not is_atomic | bool
|
||||||
|
|
||||||
|
- name: Uncomment baseurls
|
||||||
|
replace:
|
||||||
|
path: "{{ item.path }}"
|
||||||
|
regexp: '^mirrorlist=.*'
|
||||||
|
regexp: '^\s*#*\s*(baseurl=.*)'
|
||||||
|
replace: '\1'
|
||||||
|
with_items: "{{ pre_stream_repo_files.files }}"
|
||||||
|
when:
|
||||||
|
- ansible_facts['distribution'] == 'CentOS'
|
||||||
|
- ansible_facts['distribution_major_version'] | int > 7
|
||||||
|
- not is_atomic | bool
|
||||||
|
|
||||||
|
- name: Point baseurls to archive server
|
||||||
|
replace:
|
||||||
|
path: "{{ item.path }}"
|
||||||
|
regexp: 'mirror.centos.org/\$contentdir/\$stream'
|
||||||
|
replace: 'apt-mirror.front.sepia.ceph.com/centos/8-stream'
|
||||||
|
with_items: "{{ pre_stream_repo_files.files }}"
|
||||||
|
when:
|
||||||
|
- ansible_facts['distribution'] == 'CentOS'
|
||||||
|
- ansible_facts['distribution_major_version'] | int > 7
|
||||||
|
- not is_atomic | bool
|
||||||
|
|
||||||
- name: update the system
|
- name: update the system
|
||||||
command: dnf update -y
|
command: dnf update -y
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
Loading…
Reference in New Issue