Re: [Puppet Users] using 'define': modelling a file-like construction.

2009-12-24 Thread Peter Meier
> Wouldn't this possibly have unintended consequences, or would the scope > of the overrides be restricted to the define in this case? afair it's restricted to the scope. cheers pete -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to

Re: [Puppet Users] using 'define': modelling a file-like construction.

2009-12-24 Thread Trevor Vaughan
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Wouldn't this possibly have unintended consequences, or would the scope of the overrides be restricted to the define in this case? Trevor On 12/22/2009 08:14 AM, R.I.Pienaar wrote: > hello, > > You can use the ability to set defaults for resources:

Re: [Puppet Users] using 'define': modelling a file-like construction.

2009-12-22 Thread Trevor Vaughan
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'm not sure if this will work as I haven't tested it, but try setting source and content to 'undef' (no quotes) instead of false. Trevor On 12/22/2009 08:00 AM, Daniel Pittman wrote: > G'day. > > I sometimes want to write a 'define' that wraps some

Re: [Puppet Users] using 'define': modelling a file-like construction.

2009-12-22 Thread R.I.Pienaar
hello, You can use the ability to set defaults for resources: define mfile($content = undef, $source = undef) { if $content { File[$name] { content => $content } } else { File[$name] {

[Puppet Users] using 'define': modelling a file-like construction.

2009-12-22 Thread Daniel Pittman
G'day. I sometimes want to write a 'define' that wraps some higher level behaviour around a low level 'file' statement, akin to this: define example ($source = false, $content = false) { file { "/path/to/whatever/${name}": ensure => file, source => $source, content => $content,