daily pastebin goal
58%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 42 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $server = "puppet.example.com"
  2.  
  3. # The same as a file, except that the source is always taken
  4. # relative to the /config module on the file server
  5. define configfile($owner = root, $group = root, $mode = 644, $source,
  6.                   $backup = false, $recurse = false, $ensure = file) {
  7.     file { $name:
  8.             mode => $mode,
  9.             owner => $owner,
  10.             group => $group,
  11.             backup => $backup,
  12.             recurse => $recurse,
  13.             ensure => $ensure,
  14.             source => "puppet://$server/config/$source"
  15.     }
  16. }
  17.  
  18. define yumrepo($enabled = true) {
  19.   configfile { "/etc/yum.repos.d/$name.repo":
  20.     mode => 644,
  21.     source => "/yum/repos/$name.repo",
  22.     ensure => $enabled ? {
  23.               true => file,
  24.               default => absent
  25.              }
  26.   }
  27. }
  28.  
  29. class yum-default {
  30.   yumrepo {
  31.     [epel]:
  32.      enabled => true;
  33.     [epel-testing]:
  34.       enabled => false
  35.   }
  36. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top