-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Keith Edmunds wrote:
> I'm trying to exclude uploading a file to certain hosts. In nodes.pp I
> have:
>
> 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/else in a resource.
Have a read of:
http://reductivelabs.com/trac/puppet/wiki/LanguageTutorial#conditionals
Regards
James Turnbull
- --
Author of:
* Pulling Strings with Puppet
(http://www.amazon.com/gp/product/1590599780/)
* Pro Nagios 2.0
(http://www.amazon.com/gp/product/1590596099/)
* Hardening Linux
(http://www.amazon.com/gp/product/1590594444/)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFJx3G49hTGvAxC30ARAj8+AJ9jek7EArJG3apQeDHtzNmCeR7wQgCfXPBv
oy9IzCuUv00wz/wsjV8fcf4=
=7rcV
-----END PGP SIGNATURE-----
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---