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,
      notify => Service["some-service"],
      etc, etc, etc
    }
  }

This is great, except it doesn't work.  It returns an error that source is
nil, if I specify content, and that is that.

Instead, I get to write out the same file stanza twice, once with content and
once with source, as well as a third stanza that fails when neither is set.


Wouldn't it be wonderful if there was a standard way to express this idiom?

        Daniel

...now someone is gonna tell me that I missed something obvious, but that is
fine with me: saving the time I waste on these is worth enough for me. :)

-- 
✣ Daniel Pittman            ✉ dan...@rimspace.net            ☎ +61 401 155 707
               ♽ made with 100 percent post-consumer electrons

--

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