A puppet-lint plugin to check "exec" resources to ensure they have been written in an idempotent manner. Basically, ensure they used "onlyif", "unless", or "refreshonly".
$ gem install puppet-lint-exec_idempotent-check
gem 'puppet-lint-exec_idempotent-check'
For an exec
resource to pass it must be using at least one parameter that ensures idempotence. The value being passed to the parameter is not checked. The parameters this
check will expect to find are one of "onlyif", "unless", or "refreshonly" as the use of any one of these is considered to ensure idempotance for the exec
resource. This check
is, of course, opinionated in that regard, and to that end the "creates" parameter is not considered acceptable. This check does not view the creates parameter as a good
practice.
To disable this check, you can add --no-exec_idempotent-check
to your puppet-lint command line.
$ puppet-lint --no-exec_idempotent-check path/to/file.pp
Alternatively, if you’re calling puppet-lint via the Rake task, you should insert the following line to your Rakefile
.
PuppetLint.configuration.send('disable_exec_idempotent')
This check provides none! Fix your stuff :)