Ask Your Question

Override noop when set in a type

asked 2013-02-21 16:38:13 -0500

niranjan gravatar image


Is there a way to override noop if its set within a type? Looks like --no-noop has no effect in this scenario. I see this as a feature request but has been closed:

Ex: class blah { exec { danger: noop => true, tag => hitme, command => "mightbreakit", path => "/bin:/usr/bin:/usr/local/bin", logoutput => true } }

I should be able to override the above setting with: puppet agent -t --no-noop, but looks like it doesn't work. I am using Puppet 3.1

Any chance this may be revisited or if there are any workarounds?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-02-22 12:24:41 -0500

Stefan gravatar image

The noop setting of a resource has a higher priority than the general noop agent setting, so if you specify noop => true at the resource level, the resource will always apply with noop.

One option I can think of is using the fact that an environment setting FACTER_foo will become the fact foo in facter. So you can write your manifest like:

$exec_noop => $::apply_dangerous_settings ? {
  'y'     => undef,
  default => true,

exec { 'echo foo':
  noop => $exec_noop,

if you now run your agent as puppet agent -t the noop setting will be true so you will never run the dangerous code. But if you ... (more)

edit flag offensive delete link more


Stefan, thanks for the response. Your suggestion is very interesting! It got me thinking! For the time being, I decided to set noop at the global level (in pupet.conf ...(more)

niranjan gravatar imageniranjan ( 2013-03-08 15:14:21 -0500 )edit

I would like to 'accept' the answer, but cannot figure how to!! Is it that only a moderator can accept an answer?

niranjan gravatar imageniranjan ( 2013-03-08 15:15:23 -0500 )edit

a moderator or the one who asked the question can mark an answer as correct. The only thing that I can think about is that you use the noscript plugin ...(more)

Stefan gravatar imageStefan ( 2013-03-08 15:50:28 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-02-21 16:38:13 -0500

Seen: 421 times

Last updated: Feb 22 '13