-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

closed as off-topic by Dennis Kaarsemaker, Iain, Rob Moir, Nathan C, Jenny D Sep 24 '14 at 12:58

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must demonstrate a minimal understanding of the problem being solved. Try including attempted solutions, why they didn't work, and the expected results. See How can I ask better questions on Server Fault? for further guidance." – Iain, Rob Moir, Nathan C, Jenny D
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 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
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).

  • No, this yum module is something I wrote for my local installation (and since abandoned and replaced with the yumrepo resource). – Sven Sep 24 '14 at 11:26
  • Thanks @SvW, got the logic now. All working. Much appreciated – Chelseawillrecover Sep 24 '14 at 11:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.