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

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/ff6c1dcb-3787-4e78-b472-fc2e7f6c62ec%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to