how to force an error

40 views
Skip to first unread message

Jose Luis Ledesma

unread,
Jul 3, 2014, 6:21:33 AM7/3/14
to puppet...@googlegroups.com
Hi,

   Does exist some way to force a  error while applying the catalog? We need to check some facts vs configuration and force an error if doesnt' match, so we could have a report from the node in the puppetdb with the failed state. (we cannot use a compilation/evaluation error because it doesn't report to the puppetdb)

  Currently we use this ugly workaround:

    exec {'dummy exec to force an error':
      path => ['/bin'],
    }

  Is there any better solution?

thanks,
 

Ken Barber

unread,
Jul 3, 2014, 7:53:47 AM7/3/14
to Puppet Users
> Does exist some way to force a error while applying the catalog? We need
> to check some facts vs configuration and force an error if doesnt' match, so
> we could have a report from the node in the puppetdb with the failed state.
> (we cannot use a compilation/evaluation error because it doesn't report to
> the puppetdb)

This is fixed in the next release, 2.1.0.

> Currently we use this ugly workaround:
>
> exec {'dummy exec to force an error':
> path => ['/bin'],
> }
>
> Is there any better solution?

I know its vapourware until its released, but I'd wait for 2.1.0 and
use the fail function,

ken.

jcbollinger

unread,
Jul 3, 2014, 9:08:37 AM7/3/14
to puppet...@googlegroups.com


Not really.  You could write a custom type that always fails, but that seems a lot of trouble, and not necessarily any better.  I'd write that exec a little prettier, though:

exec { 'Intentional Failure':
  command => '/bin/false'
}


John

Reply all
Reply to author
Forward
0 new messages