config.pp 1.2 KB
Newer Older
Emmanuel Medernach's avatar
Emmanuel Medernach committed
1
class yum::config {
2 3 4 5 6 7

  file { "/etc/yum.conf":
    owner => 'root',
    group => 'root',
    mode => '0644',
    content => template('yum/yum.conf.erb'),
Emmanuel Medernach's avatar
Emmanuel Medernach committed
8
  }
9

10 11
  if (is_array($yum::repositories[$yum::profile])) {
    $listofrepos = array2hash($yum::repositories[$yum::profile], $yum::description)
Emmanuel Medernach's avatar
Emmanuel Medernach committed
12

13 14
    create_resources(yumrepo, $listofrepos)
  }
15 16 17 18

  $yum::groups.each |$group| {
    if (has_key($yum::grouplist, $group)) {
      if ($yum::grouplist[$group] != undef) {
19
        ensure_packages([$yum::grouplist[$group]])
20 21 22 23
      }
      
      } else {
      notify {"Warning: yum group ${group} is absent from yum::grouplist !":}
Emmanuel Medernach's avatar
Emmanuel Medernach committed
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
      }
  }
  
  if $yum::autoupdate {
    package { "yum-cron":
      ensure => 'installed',
    }

    file { "/etc/yum/yum-cron.conf":
      ensure  => present,
      source  => "puppet:///modules/yum/yum-cron.conf",
      owner   => 'root',
      group   => 'root',
      mode    => '0644',
    }

    file { "/etc/yum/yum-cron-hourly.conf":
      ensure  => present,
      source  => "puppet:///modules/yum/yum-cron-hourly.conf",
      owner   => 'root',
      group   => 'root',
      mode    => '0644',
    }

    service { 'yum-cron':
      ensure => running,
      enable => true,
    }
  }
  
Emmanuel Medernach's avatar
Emmanuel Medernach committed
54
}