Hi,
i want to use Puppet to install all packages from a webserver (no repository) .
Therefore I wrote following Script:
class install_package {
case "$operatingsystem" {
SLES: {
notify {"${operatingsystem} ${operatingsystemrelease} detected":}
notify {"Installing $packagename now:":}
exec { 'installing $packagename':
command => "rpm -iv ${repopath}${packagename}",
path => ["/usr/bin", "/usr/sbin", "/bin"]
}
}
}
}
The Script works perfekt if the Variables are inside the Script.
Now I want to use this class for Building a tomcat server.
In this case I have to use the class 2 times.
I tried to change the contend of the variable , but I only get error.
I see no functioning possibility to use the class 2 times and to give them the Variables $packagename and $repopath.(packagename changing )
I tried to use it in a parametrezied class as following:
class tomcat {
class {'install_package':
packagename => "mypackage.rpm",
repopath => "
http://www.something.de",
}
class {'install_package':
packagename => "mypackagename2.rpm",
repopath => "
http://www.something.de",
}
}
class install_package {
case "$operatingsystem" {
SLES: {
notify {"${operatingsystem} ${operatingsystemrelease} detected":}
notify {"Installing $packagename now:":}
exec { 'installing $packagename':
command => "rpm -iv ${repopath}${packagename}",
path => ["/usr/bin", "/usr/sbin", "/bin"]
}
}
}
}
that wars also not possible. I
I have no idea anymore. Pls help me