Execution
Date 26 Aug 2024 13:33:11 +0100
Duration 00:03:30.72
Controller ssh-gw-4.layershift.com
User root
Versions
Ansible 2.16.4
ara 1.7.1 / 1.7.1
Python 3.10.10
Summary
382 Hosts
4 Tasks
1516 Results
1 Plays
1 Files
0 Records

File: /home/ssh-gateway/ansible/1.yaml

---
- name: Check for Yum repository problems
  hosts: all
  become: yes
  tasks:
    - name: Check yum repolist
      shell: yum repolist
      register: yum_repolist_output
      ignore_errors: yes

    - name: Report if there are issues with yum repositories
      debug:
        msg: |
          WARNING: There is a problem with the yum repositories.
          Details:
          {{ yum_repolist_output.stderr }}
      when: yum_repolist_output.rc != 0

    - name: Check for specific issues in yum repolist stderr
      debug:
        msg: |
          ERROR: Issue detected - {{ item }}
      loop:
        - 'Could not resolve host'
        - 'Failed to synchronize cache'
        - 'No more mirrors to try'
      when: item in yum_repolist_output.stderr