Hello,
I need help with setting up Centos client-server with centos repository
URL. It should add a repository URL to the client-server and patch to the
next available version identifying the existing os version.
I have created a role but the patching task gets failed because of no
mirrors found. Any help here would be appreciated.
===========================================================================================================================
main.yml code:
- name: Perform Patch
include_tasks: centos.yml
when: ansible_distribution == "CentOS"
- name: Perform Patch
include_tasks: redhat.yml
when: ansible_distribution == "RedHat"
- name: Perform Patch
include_tasks: ubuntu.yml
when: ansible_distribution == "Ubuntu" or ansible_distribution == "Debian"
- name: Perform Patch
include_tasks: suse.yml
when: ansible_distribution == "openSUSE Leap"
==================================================================================================================================================
centos.yml code:
- name: Enable centos repo in yum
template:
src: centos.repo.j2
dest: /etc/yum.repos.d/CentOS-Base.repo
- name: Check Dist Version
shell: cat /etc/redhat-release
register: response
- name: Contents of the register
debug: msg="{{ response.stdout }}"
- name: Distribution
debug: msg="{{ ansible_distribution }}"
- name: Distribution version
debug: msg="{{ ansible_distribution_version}}"
- name: Distribution major version
debug: msg="{{ ansible_distribution_major_version }}"
- name: Upgrade all installed packages for CentOS
yum:
name: "*"
state: latest
when: ansible_distribution == "CentOS"
=================================================================================================================================================
centos.repo.j2 file in template:
[base]
name = CentOS
baseurl = http://mirror.centos.org/{{ ansible_distribution | lower }}/{{
ansible_distribution_major_version }}/updates/{{ ansible_architecture }}
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
gpgcheck = 1
enabled = 1
==================================================================================================================================================
Error:
TASK [template.patching : Upgrade all installed packages for CentOS]
**************************************************************
fatal: [waldevprodcen02]: FAILED! => {"changed": true, "changes":
{"installed": [], "updated": [["freerdp-libs", "2.0.0-4.rc4.el7_8.x86_64
from base"] Not found\nError: Package: vinagre-3.22.0-9.el7.x86_64
(@anaconda)\n Requires: libfreerdp-utils.so.1.0()(64bit)\n
Removing: freerdp-libs-1.0.2-15.el7.x86_64 (@anaconda)\n
libfreerdp-utils.so.1.0()(64bit)\n Updated By:
freerdp-libs-2.0.0-4.rc4.el7_8.x86_64 (base)\n Not
found\nError: Package: mesa-libxatracker-18.3.4-7.el7_8.1.x86_64 (base)\n
Requires: libLLVM-7-rhel.so(LLVM_7)(64bit)\nError: Package:
1:java-1.7.0-openjdk-headless-1.7.0.261-2.6.22.2.el7_8.x86_64 (base)\n
Requires: nss-softokn(x86-64) >= 3.44.0\n Installed:
nss-softokn-3.36.0-5.el7_5.x86_64 (@anaconda)\n
nss-softokn(x86-64) = 3.36.0-5.el7_5\nError: Package:
vinagre-3.22.0-9.el7.x86_64 (@anaconda)\n Requires:
libfreerdp-rail.so.1.0()(64bit)\n Removing:
freerdp-libs-1.0.2-15.el7.x86_64 (@anaconda)\n
libfreerdp-rail.so.1.0()(64bit)\n Updated By:
freerdp-libs-2.0.0-4.rc4.el7_8.x86_64 (base)\n Not
found\nError: Package: 12:dhclient-4.2.5-68.el7.centos.1.x86_64
(@anaconda)\n Requires: libisc-export.so.95()(64bit)\n
Removing: 32:bind-libs-lite-9.9.4-72.el7.x86_64 (@anaconda)\n
libisc-export.so.95()(64bit)\n Updated By:
32:bind-libs-lite-9.11.4-16.P2.el7_8.6.x86_64 (base)\n Not
found\nError:
PLAY RECAP
************************************************************************************************************************
waldevprodcen02 : ok=8 changed=1 unreachable=0
failed=1 skipped=0 rescued=0 ignored=0
========================================================================================================================================
Centos URL:
http://mirror.centos.org/centos/7/
Thanks,
Snehal
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/181f383d-7601-405a-9f20-d740411b55a3o%40googlegroups.com.