Thank you to you and Daniel, both your methods do what I want.
On Wed, Sep 21, 2011 at 12:58:38PM -0700, Dan Bode wrote:
> using the fail function should work:
>
> content = inline_template('<%= fail("doh") %>')
>
> On Wed, Sep 21, 2011 at 12:56 PM, Daniel Pittman
> <[1][email protected]> wrote:
>
> On Wed, Sep 21, 2011 at 12:00, Christopher Wood
> <[2][email protected]> wrote:
> > How do I cause template failure in the erb ruby? I'd like the same
> kind of failure as for a template syntax issue, where puppet keeps
> going. I know I can use "exit" in a template, but I haven't yet tested
> if that will simply cause my puppet agent to exit altogether.
>
> I believe you should be able to `raise Puppet::Error, "your message
> here"` and have that fail in the way you desire.
>
> Daniel
> --
> ⎋ Puppet Labs Developer – [3]http://puppetlabs.com
> ♲ 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 [4][email protected].
> To unsubscribe from this group, send email to
> [5][email protected].
> For more options, visit this group at
> [6]http://groups.google.com/group/puppet-users?hl=en.
>
> --
> "Join us for [7]PuppetConf, September 22nd and 23rd in Portland, OR."
>
> --
> 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.
>
> References
>
> Visible links
> 1. mailto:[email protected]
> 2. mailto:[email protected]
> 3. http://puppetlabs.com/
> 4. mailto:[email protected]
> 5. mailto:puppet-users%[email protected]
> 6. http://groups.google.com/group/puppet-users?hl=en
> 7. http://bit.ly/puppetconfsig
--
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.