Commit 8b52ebe5 authored by Emmanuel Medernach's avatar Emmanuel Medernach
Browse files

Decoupage du module yum en yum + iphc_packages

parent 94d3462c
## Yum repository management
Configure:
- yum-cron
- yum.conf
### Example
File hiera.yaml:
......
class yum::config {
file { $yum::reposdir:
ensure => directory,
owner => "root",
mode => "0755",
}
file { "/etc/yum.conf":
owner => 'root',
group => 'root',
mode => '0644',
content => template('yum/yum.conf.erb'),
}
if (is_array($yum::repositories[$yum::profile])) {
$listofrepos = array2hash($yum::repositories[$yum::profile], $yum::description)
$newlistofrepos = $listofrepos.map |$key, $value| {
if (has_key($value, 'descr')) {
{ $key => $value }
} else {
{ $key => $value + {'descr' => 'Missing descr field in yum::description entry'} }
}
}
$newlistofrepos.each |$repos| {
create_resources(yumrepo, $repos)
}
}
$yum::groups.each |$group| {
if (has_key($yum::grouplist, $group)) {
if ($yum::grouplist[$group] != undef) {
ensure_packages([$yum::grouplist[$group]])
}
} else {
notify {"Warning: yum group ${group} is absent from yum::grouplist !":}
}
}
if $yum::autoupdate {
package { "yum-cron":
......
class yum(
$reposdir, # Repository directory
$autoupdate,
$distroversionpackage, # distroverpkg variable from yum.conf
$reposdir = '/etc/yum.repos.d', # Repository directory
$description, # List of all available repositories
$repositories, # List of repositories to be installed
$packages, # List of packages to install
$profile, # Profile type (set of repositories to install)
$autoupdate = false,
$groups, # List of package group names
$grouplist, # List of package groups
$exclude = '',
) {
package { $packages:
ensure => 'installed',
}
file { $reposdir:
ensure => directory,
owner => "root",
mode => "0755",
}
include yum::config
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment