Hi
> node "x.example.com" inherits basenode {
> $skip_file = true
> }
>
> In the module's init.pp I have:
>
> file {"/path/to/file":
> if $skip_file {
> noop => true
> }
> owner => root,
> .
> .
>
> I get an error:
>
> err: Could not retrieve catalog: Could not parse for environment
> production: Syntax error at 'if'; expected '}' at ...
>
> Is this a reasonable way of excluding one file from certain hosts? Also, I
> clearly do not understand the syntax for 'if' (and it's very hard to
> Google "puppet if statement"), so what am I doing incorrectly?
you can't use if statements this way. use a selector instead. So
something like:
file {"/path/to/file":
noop => $skip_file ? {
true => true,
default => false
},
owner => root,
....
cheers pete
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---