Score:0

Failing execute yum from ansible on centos 8

us flag

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

John Mahowald avatar
cn flag
Please edit your question to add the full repo configuration. It matters if the URL was set to a baseurl or a mirrorlist key.
us flag
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
Zeitounator avatar
fr flag
Please do not add needed information to answer your question as bits and pieces in comments: [edit your question instead](/posts/1097955/edit)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.