Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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