diff --git a/ansible/roles/dnf/tasks/local-mirror.yml b/ansible/roles/dnf/tasks/local-mirror.yml index 98241efa3..da25a034b 100644 --- a/ansible/roles/dnf/tasks/local-mirror.yml +++ b/ansible/roles/dnf/tasks/local-mirror.yml @@ -1,7 +1,7 @@ --- -- name: Copy CentOS repo templates +- name: Copy Rocky/CentOS repo templates vars: - repo_file_prefix: "{{ ansible_facts.distribution }}{% if ansible_facts.distribution == 'CentOS'%}-Stream{% endif %}" + repo_file_prefix: "{{ ansible_facts.distribution | lower }}" template: src: "{{ item }}.j2" dest: /etc/yum.repos.d/{{ item }} @@ -9,6 +9,18 @@ group: root mode: 0664 become: True + loop: + - "{{ repo_file_prefix }}.repo" + - "{{ repo_file_prefix }}-extras.repo" + +# TODO(bbezak): remove following task in B release +- name: Remove incorrect uppercase repo files + vars: + repo_file_prefix: "{{ ansible_facts.distribution }}{% if ansible_facts.distribution == 'CentOS'%}-Stream{% endif %}" + file: + path: /etc/yum.repos.d/{{ item }} + state: absent + become: True loop: - "{{ repo_file_prefix }}-AppStream.repo" - "{{ repo_file_prefix }}-BaseOS.repo" diff --git a/ansible/roles/dnf/templates/CentOS-Stream-BaseOS.repo.j2 b/ansible/roles/dnf/templates/CentOS-Stream-BaseOS.repo.j2 deleted file mode 100644 index 1ba0747d6..000000000 --- a/ansible/roles/dnf/templates/CentOS-Stream-BaseOS.repo.j2 +++ /dev/null @@ -1,17 +0,0 @@ -# CentOS-Stream-BaseOS.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for CentOS updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[baseos] -name=CentOS Stream $releasever - BaseOS -baseurl=http://{{ dnf_centos_mirror_host }}/{{ dnf_centos_mirror_directory }}/$stream/BaseOS/$basearch/os/ -gpgcheck=1 -enabled=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial -fastestmirror=0 diff --git a/ansible/roles/dnf/templates/Rocky-BaseOS.repo.j2 b/ansible/roles/dnf/templates/Rocky-BaseOS.repo.j2 deleted file mode 100644 index 0931719bd..000000000 --- a/ansible/roles/dnf/templates/Rocky-BaseOS.repo.j2 +++ /dev/null @@ -1,16 +0,0 @@ -# Rocky-BaseOS.repo -# -# The mirrorlist system uses the connecting IP address of the client and the -# update status of each mirror to pick current mirrors that are geographically -# close to the client. You should use this for Rocky updates unless you are -# manually picking other mirrors. -# -# If the mirrorlist does not work for you, you can try the commented out -# baseurl line instead. - -[baseos] -name=Rocky Linux $releasever - BaseOS -baseurl=http://{{ dnf_rocky_mirror_host }}/{{ dnf_rocky_mirror_directory }}/$releasever/BaseOS/$basearch/os/ -gpgcheck=1 -enabled=1 -gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial diff --git a/ansible/roles/dnf/templates/CentOS-Stream-Extras.repo.j2 b/ansible/roles/dnf/templates/centos-extras.repo.j2 similarity index 100% rename from ansible/roles/dnf/templates/CentOS-Stream-Extras.repo.j2 rename to ansible/roles/dnf/templates/centos-extras.repo.j2 diff --git a/ansible/roles/dnf/templates/CentOS-Stream-AppStream.repo.j2 b/ansible/roles/dnf/templates/centos.repo.j2 similarity index 70% rename from ansible/roles/dnf/templates/CentOS-Stream-AppStream.repo.j2 rename to ansible/roles/dnf/templates/centos.repo.j2 index 667c6c85c..b6fb3f97d 100644 --- a/ansible/roles/dnf/templates/CentOS-Stream-AppStream.repo.j2 +++ b/ansible/roles/dnf/templates/centos.repo.j2 @@ -1,4 +1,4 @@ -# CentOS-Stream-AppStream.repo +# centos.repo # # The mirrorlist system uses the connecting IP address of the client and the # update status of each mirror to pick current mirrors that are geographically @@ -8,6 +8,14 @@ # If the mirrorlist does not work for you, you can try the commented out # baseurl line instead. +[baseos] +name=CentOS Stream $releasever - BaseOS +baseurl=http://{{ dnf_centos_mirror_host }}/{{ dnf_centos_mirror_directory }}/$stream/BaseOS/$basearch/os/ +gpgcheck=1 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial +fastestmirror=0 + [appstream] name=CentOS Stream $releasever - AppStream baseurl=http://{{ dnf_centos_mirror_host }}/{{ dnf_centos_mirror_directory }}/$stream/AppStream/$basearch/os/ diff --git a/ansible/roles/dnf/templates/Rocky-Extras.repo.j2 b/ansible/roles/dnf/templates/rocky-extras.repo.j2 similarity index 96% rename from ansible/roles/dnf/templates/Rocky-Extras.repo.j2 rename to ansible/roles/dnf/templates/rocky-extras.repo.j2 index ffb04c8f5..7ea0fa6bf 100644 --- a/ansible/roles/dnf/templates/Rocky-Extras.repo.j2 +++ b/ansible/roles/dnf/templates/rocky-extras.repo.j2 @@ -1,4 +1,4 @@ -# Rocky-Extras.repo +# rocky-extras.repo # # The mirrorlist system uses the connecting IP address of the client and the # update status of each mirror to pick current mirrors that are geographically diff --git a/ansible/roles/dnf/templates/Rocky-AppStream.repo.j2 b/ansible/roles/dnf/templates/rocky.repo.j2 similarity index 71% rename from ansible/roles/dnf/templates/Rocky-AppStream.repo.j2 rename to ansible/roles/dnf/templates/rocky.repo.j2 index e46b38dec..0c4b990c7 100644 --- a/ansible/roles/dnf/templates/Rocky-AppStream.repo.j2 +++ b/ansible/roles/dnf/templates/rocky.repo.j2 @@ -1,4 +1,4 @@ -# Rocky-AppStream.repo +# rocky.repo # # The mirrorlist system uses the connecting IP address of the client and the # update status of each mirror to pick current mirrors that are geographically @@ -8,6 +8,13 @@ # If the mirrorlist does not work for you, you can try the commented out # baseurl line instead. +[baseos] +name=Rocky Linux $releasever - BaseOS +baseurl=http://{{ dnf_rocky_mirror_host }}/{{ dnf_rocky_mirror_directory }}/$releasever/BaseOS/$basearch/os/ +gpgcheck=1 +enabled=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial + [appstream] name=Rocky Linux $releasever - AppStream baseurl=http://{{ dnf_rocky_mirror_host }}/{{ dnf_rocky_mirror_directory }}/$releasever/AppStream/$basearch/os/ diff --git a/releasenotes/notes/fix-uppercase-repo-file-r9-3ed29c34d2c945c7.yaml b/releasenotes/notes/fix-uppercase-repo-file-r9-3ed29c34d2c945c7.yaml new file mode 100644 index 000000000..1d3998b33 --- /dev/null +++ b/releasenotes/notes/fix-uppercase-repo-file-r9-3ed29c34d2c945c7.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fixes repositories files names in Rocky Linux 9. Distributions moved to + lowercase names with RHEL 9 release.