Remove old puppet repo configuration

puppetyum

I want to consolidate my repository into a new repository structure and I have this working in Puppet. However, the old yum repository information still remains on the nodes. Can puppet force the removal of the old yum repository information? How do you do it?

Best Answer

I think the best way to do this is to use a file resource with ensure => absent, as in

file { '/etc/yum.repos.d/crufty.repo':
  ensure => absent,
}

It doesn't look as if the yumrepo resource type supports removal (although you could set enabled => false, which in practice would get you the same behavior).

Related Topic