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 15
    create_resources(yumrepo, $listofrepos)
  }
  
Emmanuel Medernach's avatar
Emmanuel Medernach committed
16 17 18 19 20 21 22 23 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
  if (has_key($yum::grouplist, $yum::group)) {
    if ($yum::grouplist[$yum::group] != undef) {
      package { $yum::grouplist[$yum::group]:
        ensure => 'installed',
      }
    } 
  } else {
    notify {"Warning: yum module: yum::group is absent from yum::grouplist !":}
  }
  
  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
53
}