Hi All,
I'm pretty new to Ansible. Have started working on Ansible about a week
back.
I have given a task to create a local repo using ansible in CentOs system.
This is my yaml file:
---
- name: configuring yum local repository
hosts: testServer
remote_user: root
become: yes
tasks:
- name: Add repository
yum_repository:
name: custom_repository
description: local_repository
baseurl: file:///root/
enabled: yes
The .repo file is create /etc/yum.repos.d/ ,but i couldn't able to install
any package using this repo. When i tried to install rpm which is place in
/root/, it give the following error:
Setting up Install Process
Loading mirror speeds from cached hostfile
*file:///root/repodata/repomd.xml: [Errno 14] Could not open/read
file:///root/repodata/repomd.xml*
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository:
custom_repository. Please verify its path and try again
I understand this repomd.xml can be created by using manually by executing
"*createrepo
/root/*" executable which come as part of yum commands. I want to know, how
the "*createrepo command" *can be executed using ansible scripts? what is
parameter i have to set in Ansible script to create the repomd.xml ?
Kindly help.
Thanks
Hari
--
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/41f8519a-e693-4187-a541-99d4834565ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.