I just noticed that I wanted to run ‘yum-conf-manager’ to add http://ftp1.scientificlinux.org/linux/scientific/6.4/x86_64/addons/mock-sl6-config/ to my SL machines for testing and realised that there is probably a need for creating a yum_repository module that takes a url and adds/removes it on the managed machine (state=present,absent). Other useful things might include states=enabled,disabled as well to toggle the availability of packages from different repos. I’m not sure if you would want to have functionality like supporting adding/removing repo files though as you could just do that with the stock copy/template modules.
I just happen to have created a yum_repository plugin [1] for Ansible based on my own needs. In the environment I work with we use a continuous integration system to generate new rpm repositories throughout the day, so it’s helpful to deal with them this way. It also greatly simplifies the code for making changes to existing repositories.
For instance, if I wanted to disable my Centos updates repository, I could use something like:
ansible all -m yum_repository -a “id=updates state=disabled”
I haven’t submitted a pull request yet, but will if other people find it useful.
The yum_repository module sounds exactly what I’ve been looking for. Unfortunately the url doesn’t work and I’m unable to find it anywhere. Is it still available somewhere?