You're pretty close. You don't want the case statement per se, but you do want
a conditional:
file { "/usr/local/nagios/libexec":
require => File['/usr/local/nagios'],
ensure => directory,
owner => 'root',
group => 'root',
mode => 655,
recurse => true,
source => $::architecture {
/(i386|i586|i686/) => "puppet:///files/32/usr/local/nagios/libexec",
x86_64 => "puppet:///files/64/usr/local/nagios/libexec",
}
}
On Apr 16, 2012, at 3:43 PM, Forrie wrote:
> I want to distribute a binary directory based upon whether the
> "architecture" is 32- or 64-bit. It appears I cannot nest a case
> statement under file, however this is what I was attempting to do:
>
> file { "/usr/local/nagios/libexec":
> require => File['/usr/local/nagios'],
> ensure => directory,
> owner => 'root',
> group => 'root',
> mode => 655,
> recurse => true,
> ## APPEARS I can't do this
> case $architecture {
> /(i386|i586|i686/): {
> source => "puppet:///files/32/usr/local/nagios/
> libexec"
> }
> x86_64: {
> source => "puppet:///files/64/usr/local/nagios/
> libexec"
> }
> }
> }
>
>
> I know I could reverse it and do a case first, then have redundant
> file {} declarations, but that seems just that, redundant.
>
> Can anyone point out what I'm doing wrong here. The output in the
> puppet logs isn't generally helpful with debugging.
>
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.