helindbe
12/15/2025, 3:22 PM$content = function(’a’)
unless $content == undef {
file {”/tmp/foo”: content => $content }
That would only include the resource if function returned something other than undef.
If you are referring to some ruby error that stops the entire compilation your function would need to capture those exceptions and return nil.
If the function is not yours to change you could write a wrapper function that adds the error handling behavior and make that function call the original.
Dies this answer your question?