geerlingguy / ansible-role-repo-epel

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

Once disabled, epel repository cannot be re-enabled #50

Closed isuftin closed 3 years ago

isuftin commented 3 years ago

I have a weird use case where I need to use this role to install and enable the epel repo, install stuff and then disable the repo during a molecule prepare step.

In the actual playbook I also want to use this role to enable the epel repo even if it's been disabled (enabled=0). But there's no way to do that with this role. The only thing I can do is delete the epel file out of the repos config directory in /etc/yum

Perhaps this line https://github.com/geerlingguy/ansible-role-repo-epel/blob/master/tasks/main.yml#L33 should be something along the lines of:

value: "{{ 0 if epel_repo_disable | bool else 1 }}"

and remove https://github.com/geerlingguy/ansible-role-repo-epel/blob/master/tasks/main.yml#L35 ?

isuftin commented 3 years ago

This issue was implemented in version 3.1.0