0

I have a problem updating Centos 8 systems due to repositories. This is my task and it works on Red Hat and Almalinux:


- name: Install the latest version of yum-utils
  become: yes
  become_method: sudo
  yum:
    name: yum-utils
    state: latest
    update_cache: yes

When I run the Playbook, I get this result:

"Failed to download metadata for repo 'AppStream': Cannot download repomd.xml: Cannot download repodata / repomd.xml:"

I replaced the repositories with http://vault.centos.org/$contentdir/$releasever/AppStream/$basearch/os/ and, running the "yum update" command directly from the CentOS system it works, from the playbook it doesn't. I can't understand, can anyone help me?

The versions of Python are 3.6.8 and Ansible 2.9.27

Thanks for your help

Rob
  • 1,175
  • 1
  • 7
  • 2
    Please edit your question to add the full repo configuration. It matters if the URL was set to a baseurl or a mirrorlist key. – John Mahowald Apr 06 '22 at 23:27
  • Hi, this is yum config: [AppStream] name=CentOS-$releasever - AppStream baseurl=https://vault.centos.org/$contentdir/$releasever/AppStream/$basearch/os/ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial and this is for CentOS Stream: [appstream] name=CentOS Stream $releasever - AppStream mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=AppStream&infra=$infra gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial – Alessandro Mostardi Apr 07 '22 at 07:08
  • 1
    Please do not add needed information to answer your question as bits and pieces in comments: [edit your question instead](/posts/1097955/edit) – Zeitounator Apr 23 '22 at 10:09

0 Answers0