]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
Remove "switch back from mirrorlist" code for CentOS
authorDan Mick <dmick@redhat.com>
Thu, 20 Apr 2023 20:26:12 +0000 (13:26 -0700)
committerDan Mick <dmick@redhat.com>
Thu, 20 Apr 2023 20:48:28 +0000 (13:48 -0700)
The plan is to use mirrorlist exclusively (as we've done for
EPEL) because the upstream infra is changing more rapidly than
our fixed list of mirrors, and hopefully it's more stable than
it was in the past when we were driven to this coping mechanism
of caching mirror lists.

Signed-off-by: Dan Mick <dmick@redhat.com>
roles/testnode/tasks/yum/baseurls_not_mirrorlists.yml [deleted file]
roles/testnode/tasks/yum/repos.yml

diff --git a/roles/testnode/tasks/yum/baseurls_not_mirrorlists.yml b/roles/testnode/tasks/yum/baseurls_not_mirrorlists.yml
deleted file mode 100644 (file)
index b458bf5..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
----
-- name: dnf check-update to see if mirrorlists are working
-  command: dnf check-update
-  register: mirrorlist_check
-  ignore_errors: true
-
-# Default to false
-- set_fact:
-    use_baseurls: false
-
-- set_fact:
-    use_baseurls: true
-  when: '"all mirrors were already tried" in mirrorlist_check.stderr'
-
-- name: Get list of repo files we need to use baseurls for
-  shell: "grep -l '^mirrorlist' *.repo | grep -v epel | cut -d '.' -f1"
-  args:
-    chdir: /etc/yum.repos.d
-  register: repo_files_with_mirrorlists
-  when: use_baseurls|bool
-
-- name: Comment mirrorlist parameter in each repo
-  shell: "sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/{{ item }}.repo"
-  with_items: "{{ repo_files_with_mirrorlists.stdout_lines }}"
-  when: use_baseurls|bool
-
-- name: Use a baseurl instead
-  shell: "echo 'baseurl=http://packages.oit.ncsu.edu/centos/{{ ansible_distribution_major_version }}{{ dash_stream }}/{% if item == \"CentOS-Extras\" %}extras{% else %}{{ item | regex_replace('CentOS-','') }}{% endif %}/{{ ansible_architecture }}/os/' >> /etc/yum.repos.d/{{ item }}.repo"
-  with_items: "{{ repo_files_with_mirrorlists.stdout_lines }}"
-  when: use_baseurls|bool
index 7a99ada414ab98c13ef8bc1f1ff0e2446c326291..278d8d7f6ed0261d899bf7a61adc74d3b42429b8 100644 (file)
   with_dict: "{{ yum_repos|default({}) | combine(additional_yum_repos|default({}), recursive=True) }}"
   when: (yum_repos.keys() | length > 0) or (additional_yum_repos.keys() | length > 0)
 
-# Occasionally when the yum repo mirrors get updated, we get 404s when using mirrorlist
-# but not when using baseurls. No idea why.
-- include_tasks: yum/baseurls_not_mirrorlists.yml
-  when: ansible_distribution == "CentOS"
-
 - name: Enable copr repos
   command: "dnf -y copr enable {{ item }}"
   with_items: "{{ copr_repos }}"