class auth {
case $operatingsystem {
"Ubuntu": {
$wantedpackages = [ "openldap-utils","libnss-ldap" ]
$pamdfiles = [ "common-auth","common-account","common-password","common-session" ]
}
"all": {
$wantedpackages = [ "openldap-clients","nss_ldap" ]
$pamdfiles = [ "system-auth-ac" ] }
}
package { $wantedpackages: ensure => installed }
}
vs
class apache {
case $operatingsystem {
"Ubuntu": {
$apache_conf_dir = "/etc/apache2/sites-enabled/"
$apache_name = "apache2"
$wantedpackages = [ "$apache_name","php","php-mysql","php-mcrypt","php-mhash","php-mbstring","perl-URI"]
}
"all": {
$apache_conf_dir = "/etc/httpd/conf.d"
$apache_name = "httpd"
$wantedpackages = [ "$apache_name","php","php-mysql","php-mcrypt","php-mhash","php-mbstring","perl-URI"]
}
}
}
errors with:
err: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate definition: Package[] is already defined in file /etc/puppet/modules/auth/manifests/init.pp at line 20; cannot redefine at /etc/puppet/modules/apache/manifests/init.pp:29 on node sdc01ppt01