Ask Your Question

where should i configure yum repos ? In puppet master or puppet Agent?

asked 2015-11-09 11:20:54 -0600

sandeep gravatar image

For the module to be installed in an agent from the master, i came to know that yum repository should be configured so that the module can extract the software packages from yum repos. But my question where should we configure yum?whether in puppet master or puppet Agent? Can someone please explain?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-11-09 18:23:24 -0600

GregLarkin gravatar image

The basic idea behind writing Puppet code is that you are declaring what the final configuration of the agent node shall be. So if you want to configure a yum repository on an agent node, you write some code to do that like so:

yumrepo { 'myrepo':
  baseurl  => "${::operatingsystem}/${::operatingsystemrelease}/${::architecture}",
  descr    => "My Local Repo",
  enabled  => 1,
  gpgcheck => 0,

Recognize the fact that this code is stored on the Puppet master, and it's compiled on the Puppet master into a catalog that's delivered to the Puppet agent running on a server. The Puppet agent processes the catalog, and when it encounters this resource, it will make sure that the yum repository file has been created and has the correct content. You will end up with a file /etc/yum.repos.d/myrepo.repo on your server with content similar to this:

name=My Local Repo

Once that repository has been configured, you can write package resources that will also be enforced on your agent node, and the packages may be downloaded from that new repository.

You'll also likely want to add a dependency so that any yumrepo resource is processed before any package resource. You can do that with one line by adding this to your code:

Yumrepo <| |> -> Package <| |>

Hope that answers your question!

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-11-09 11:20:54 -0600

Seen: 143 times

Last updated: Nov 09 '15