Defined Type: yum::group
- Defined in:
- manifests/group.pp
Overview
Define: yum::group
This definition installs or removes yum package group.
Parameters:
[*ensure*] - specifies if package group should be
present (installed) or absent (purged)
[*timeout*] - exec timeout for yum groupinstall command
Actions:
Requires:
RPM based system
Sample usage:
yum::group { 'X Window System':
ensure => present,
}
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 |
# File 'manifests/group.pp', line 20
define yum::group (
$ensure = present,
$timeout = undef,
) {
Exec {
path => '/bin:/usr/bin:/sbin:/usr/sbin',
environment => 'LC_ALL=C'
}
case $ensure {
present,installed: {
exec { "yum-groupinstall-${name}":
command => "yum -y groupinstall '${name}'",
unless => "yum grouplist hidden '${name}' | egrep -i '^Installed.+Groups:$'",
timeout => $timeout,
}
}
absent,purged: {
exec { "yum-groupremove-${name}":
command => "yum -y groupremove '${name}'",
onlyif => "yum grouplist hidden '${name}' | egrep -i '^Installed.+Groups:$'",
timeout => $timeout,
}
}
default: {
fail("Invalid ensure state: ${ensure}")
}
}
}
|