Ask Your Question

How can we stop overriding a command to execute repeatedly in the manifest

asked 2017-03-28 11:33:32 -0600

Mahender gravatar image

Hi Team,

Could you please help regarding the command which can restrict the command not to override repeatedly.

  1. Once after the successful execution the manifest should not repeat the command again(what condition can be used?).
  2. The condition has to be placed in the "exec" of the manifest.

Please let us know what can be done to restrict the puppet not to execute the same command repeatedly(once after successful execution).

Thanks, Mahender

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-03-28 12:57:36 -0600

puser gravatar image

Puppet is a configuration management tool that manages state. It ensures a state of a system. That being said exec resources are the worst way to accomplish a state. I would imagine that 99% of problems can be solved without them.

That being said you can set the creates flag on an exec resource to see if a file or directory is there after your exec runs.

For example if you have a simple exec that downloaded an rpm, you could check to see if that rpm is there in the creates section.

If you exec is not creating anything you can use the onlyif parameter on the resource to run onlyif the given command returns a 0 status code. These are pretty fundamental parameters, I suggest reading more closely at the puppet resources:

edit flag offensive delete link more

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: 2017-03-28 11:33:32 -0600

Seen: 172 times

Last updated: Mar 28 '17