geerlingguy / ansible-role-repo-epel

Ansible Role - EPEL Repository for RHEL/CentOS
https://galaxy.ansible.com/geerlingguy/repo-epel/
MIT License
185 stars 149 forks source link

unable to re-generate /etc/yum.repos.d/epel*.repo file #19

Closed shamimgeek closed 7 years ago

shamimgeek commented 7 years ago

if /etc/yum.repos.d/epel.repo or /etc/yum.repos.d/epel-testing.repo removed.

This playbook is unable to re-generate the files.

geerlingguy commented 7 years ago

@shamimgeek - What are the steps to reproduce this issue? Did you run the role, then manually SSH into the server, delete those files, then try to run this role again?

The role simply uses Ansible's yum module (https://github.com/geerlingguy/ansible-role-repo-epel/blob/master/tasks/main.yml#L7) to download/install the EPEL rpm, and that's about it... it's meant to install the repo if it's never been installed before, but I don't have any guarantees of what will happen if it's run on a broken server...

shamimgeek commented 7 years ago

To re-produce this issue :

How can we overcome this issue. because it may happen somebody delete the file or change the contents of the file. we want this file updated based on rhel/centos version.

Please have a look on this issue.

geerlingguy commented 7 years ago

@shamimgeek - If you're controlling the server entirely via automation, then that file should not be modified by hand. It's a similar situation to how my other roles install a package, but if you manually modify the package, I can't expect to still cleanly manage the package.

This role's purpose is only to install the RPM, and not necessarily take over the files that are placed on the filesystem by the RPM.

The intention as that this is the only role that would be managing EPEL—and if you have a more specialized case where you need to be able to delete/re-add/template the .repo files, then I would recommend either forking this role and modifying it to suit your needs or building a separate role that does exactly what you need.