Portál AbcLinuxu, 8. května 2025 17:48
class roles::yum { case $operatingsystem { Scientific, Centos, Redhat: { case $operatingsystemmajrelease { 5: { notify {'Centos5':} } 6: { notify {'Centos6':} } 7: { notify {'Centos7':} } } } Debian, Ubuntu: { notify {'Debian':} } default: { fail("UNRECOGNIZED") } }coz mi oznami jaky system na klientu mam, potreboval bych ho donutit, aby pro:
Řešení dotazu:
class h3g_oracle::packages {
if $::operatingsystemmajrelease == 5 {
$packages = [
'package1',
'packageN'
]
} elsif $::operatingsystemmajrelease == 6 {
$packages = [
'package2',
'packageM
]
} else {
fail("We don't have a list of packages for $::operatingsystem $::operatingsystemmajrelease to install for h3g_oracle::packages")
}
# Install them
singleton_packages( $packages )
}
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.