Search code examples
centospuppetyum

Add exclude to existing yum repo configuration with puppet


I'm using puppet for managing configuration a bunch of CentOS 5 servers. I would like to add a some package exclusions to the CentOS base yum repo configuration. Is there a way to do this with puppet?

I am going to use the remi repo version of some packages and want to exclude the base versions from yum. To enable remi I have a yumrepo resource defined.


Solution

  • You can use exclude parameter in yumrepo

    yumrepo { 'centos_base' :
        baseurl => "...",
        enabled => 1,
        priority => 1,
        exclude => "package-name",
    }
    

    You can also require a particular yumrepo when installing a package.

    package { "package-name" :
      ensure => installed,
      require => Yumrepo["RemiRepo"],
    }