-7

I have just started working on puppet and successfully installed the master server and agents. As part of my test, I am of the understanding that Puppet can replicate my configuration to the different nodes it manages.

On my Puppet master server, in /etc/yum.repo.d/ I have a test.repo file in it. How can i get puppet to replicate the contents of the test.repo file to other nodes. Note that other nodes don't hav this file yet as they are new machines.

Any guide would be appreciated.

In case anyone is scared to ask question relating to this and not get intimidated - I came across this site that helped with better understanding of this product and its syntax. So check here first, it might save you from

  • 1
    Read a tutorial. We're not a "write my things for me" service. – Dennis Kaarsemaker Sep 24 '14 at 11:03
  • 4
    You're missing even the most basic understanding of how puppet works, so yeah, I'd say you can't be assisted until you get off your lazy ass and learn about the tools you're trying to use. There are puppet books and tutorials all over the internet. – Dennis Kaarsemaker Sep 24 '14 at 11:45

1 Answers1

3

Look into the yumrepo(doc link) resource and use it to duplicate the file on your puppet master.

It can be used like this:

yumrepo { "cuda":
  baseurl => "http://repourl",
  descr => "cuda",
  enabled => 1,
  gpgcheck => 0
}

This approach is the (IMHO) best way to do this, but there are other possible approaches. You could treat it as a file resource like so:

file { "/etc/yum.repos.d/cobbler-config.repo":
    owner => "root",
    group => "root",
    mode => 0444,
    source => "puppet://$puppetserver/modules/yum/etc/yum.repos.d/cobbler-config-${operatingsystem}-${operatingsystemrelease}.repo",
}

In this case, this resource is part of a local puppet module named yum (which I wrote for my environment and won't be available in your installation) and it would look for the original file in /etc/puppet/modules/yum/files/etc/yum.repos.d and would look for a file named cobbler-config-fedora-19.repo (or whatever your relevant facter facts are).

Sven
  • 97,248
  • 13
  • 177
  • 225