Can someone point me in the right direction, I've got two "source"
files one 32bit, on 64bit
I've got it to work using the ternary operator but get syntax errors
if I try to use a case:

Works:

class audit {

        package {
                "audit":
                ensure  => present,
                name    => $operatingsystem ? {
                        default => "auditd",
                },
        }

        file {
                "auditd.conf":
                owner   => "root",
                group   => "root",
                mode    => "640",
                require => Package["audit"],
                path    => $operatingsystem ? {
                        default => "/etc/auditd.conf",
                },
                source  => "puppet://$server/modules/audit/
auditd.conf",
        }

        file {
                "audit.rules":
                owner => "root",
                group => "root",
                mode  => "600",
    path  => $operatingsystem ? {
      default => "/etc/audit.rules",
    },
                source => $hardwaremodel ? {
                                "x86_64" => "puppet://$server/modules/
audit/audit.rules.64",
                                default  => "puppet://$server/modules/
audit/audit.rules.32",
                },
        }

        service {
                "audit":
                enable    => "true",
                ensure    => "running",
                hasstatus => "true",
                require   => File["auditd.conf", "audit.rules"],
                subscribe => File["auditd.conf", "audit.rules"],
                name      => $operatingsystem ? {
                        default => "auditd",
                },
        }
}

Syntax Error:

Jul 23 13:20:43 <master> puppetmasterd[14197]: Syntax error at 'case';
expected '}' at /etc/puppet/modules/audit/manifests/init.pp:32 on node
<client>
Jul 23 13:20:43 <master> puppetmasterd[14197]: Syntax error at 'case';
expected '}' at /etc/puppet/modules/audit/manifests/init.pp:32 on node
<client>

class audit {

        package {
                "audit":
                ensure  => present,
                name    => $operatingsystem ? {
                        default => "auditd",
                },
        }

        file {
                "auditd.conf":
                owner   => "root",
                group   => "root",
                mode    => "640",
                require => Package["audit"],
                path    => $operatingsystem ? {
                        default => "/etc/auditd.conf",
                },
                source  => "puppet://$server/modules/audit/
auditd.conf",
        }

        file {
                "audit.rules":
                owner => "root",
                group => "root",
                mode  => "600",
    path  => $operatingsystem ? {
      default => "/etc/audit.rules",
    },
                case $hardwaremodel {
                                "x86_64": { source => "puppet://
$server/modules/audit/audit.rules.64" }
                                default:  { source => "puppet://
$server/modules/audit/audit.rules.32" }
                },
        }

        service {
                "audit":
                enable    => "true",
                ensure    => "running",
                hasstatus => "true",
                require   => File["auditd.conf", "audit.rules"],
                subscribe => File["auditd.conf", "audit.rules"],
                name      => $operatingsystem ? {
                        default => "auditd",
                },
        }
}

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to