Controlling which yum repos a client uses

31 January 2006

A very simple problem in managing Fedora machines with Puppet is that of controlling which yum repositories the machines get their updates from.

Puppet does not (yet) have a way to specify the client configuration of yum repositories; to work around this, we need to deploy the complete configuration for each repository to each client machine. To do this, we place all the repo files on puppet’s file server and make sure they all have ‘enabled=1’ set. A simple repo file may look like

[somerepo]
baseurl=http://repo.example.com/yum
enabled=1
gpgcheck=0

For the puppet manifest, we define a simple ‘yumrepo’ type (see util.pp). In the site manifest, it is now possible to say:

import "util.pp"
node client {
  yumrepo { fedora : enabled => true }
  yumrepo { fedora-devel: enabled => false }
}

Creative Commons License Watzmann.Blog by David Lutterkort is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.

Generated with Jekyll