i'm trying to learn something about ansible and the automation, unfortunately I'm getting frustrated at the early step. I just tried from debian 10 machine with ansible to write a yaml to upgrade 2 Oracle linux hosts, following a guide. What I've done is this yaml file :
root@deb-ansible-01:/opt/install_packages# cat upgrade.yaml
---
- hosts: puppa
remote_user: root
tasks:
- name: dnf upgrade
become: true
become_user: root
dnf:
name: '*'
state: latest
When I launch it with ansible-playbook the result is:
root@deb-ansible-01:/opt/install_packages# ansible-playbook upgrade.yaml
PLAY [puppa] ******************************************************************************************************************************************
TASK [Gathering Facts] ********************************************************************************************************************************
ok: [ora-puppa-002]
ok: [ora-puppa-001]
TASK [dnf upgrade] ************************************************************************************************************************************
fatal: [ora-puppa-001]: FAILED! => {"changed": false, "msg": "Failed to download metadata for repo 'ol8_baseos_latest': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried", "rc": 1, "results": []}
fatal: [ora-puppa-002]: FAILED! => {"changed": false, "msg": "Failed to download metadata for repo 'ol8_baseos_latest': : Cannot download repodata/repomd.xml: All mirrors were tried", "rc": 1, "results": []}
to retry, use: --limit @/opt/install_packages/upgrade.retry
PLAY RECAP ********************************************************************************************************************************************
ora-puppa-001 : ok=1 changed=0 unreachable=0 failed=1
ora-puppa-002 : ok=1 changed=0 unreachable=0 failed=1
from inside the hosts, I can run dnf upgrade flawless.
I tried to dnf clear, and various fixes found on dnf issue related but nothing had workd. I suspect that somethings permission related, but my knowledge is not enough to fix.
what to try?
any help is appreciated.