# need playbook for disabling all redhat repo and only to have enabled my local repo in yum  and it should done according to OS version.

**URL:** <https://forum.ansible.com/t/need-playbook-for-disabling-all-redhat-repo-and-only-to-have-enabled-my-local-repo-in-yum-and-it-should-done-according-to-os-version/28142>\
**Category:** Ansible Project\
**Tags:** rhel\
**Created:** [July 24, 2018, 7:48pm UTC](https://forum.ansible.com/t/need-playbook-for-disabling-all-redhat-repo-and-only-to-have-enabled-my-local-repo-in-yum-and-it-should-done-according-to-os-version/28142 "2018-07-24T19:48:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deepan\_M](https://avatars.discourse-cdn.com/v4/letter/d/f19dbf/32.png) [@Deepan\_M](https://forum.ansible.com/u/Deepan_M)\
**Post date:** [July 24, 2018, 7:48pm UTC](https://forum.ansible.com/t/need-playbook-for-disabling-all-redhat-repo-and-only-to-have-enabled-my-local-repo-in-yum-and-it-should-done-according-to-os-version/28142/1 "2018-07-24T19:48:25Z")

</div>

Hi,

In my environment i’m creating setup for patching, before patching i’m planning to disable redhat repo, since we have own local repo, so below few lines are copied from other source, but not working properly. please share if anyone already had some setup.

The main intention is to disable all repo’s and enable my local repo according to OS version.

Repository details:-  
RHEL6-Server-WDC  
RHEL7-Server-WDC

OS version:-  
RHEL 6 & 7

---

<div class="post-metadata">

**Author:** ![Deepan\_M](https://avatars.discourse-cdn.com/v4/letter/d/f19dbf/32.png) [@Deepan\_M](https://forum.ansible.com/u/Deepan_M)\
**Post date:** [July 27, 2018, 11:32am UTC](https://forum.ansible.com/t/need-playbook-for-disabling-all-redhat-repo-and-only-to-have-enabled-my-local-repo-in-yum-and-it-should-done-according-to-os-version/28142/2 "2018-07-27T11:32:08Z")

</div>

Can someone please share your ideas about my requirement!

Thanks,  
Deepan M
