Skip to content

Lint check to verify if an exec resource has idempotency attributes set.

License

Notifications You must be signed in to change notification settings

voxpupuli/puppet-lint-exec_idempotency-check

puppet-lint-exec_idempotency-check

License Test Release RubyGem Version RubyGem Downloads codecov

A puppet-lint plugin to check the idempotency attributes on exec resources.

Installing

From the command line

$ gem install puppet-lint-exec_idempotency-check

In a Gemfile

gem 'puppet-lint-exec_idempotency-check', :require => false

Checks

Ensure idempotency attributes are set on exec resource

When using exec resource it is highly recommended to take care on idempotency. That means, that we need a check to verify if the command should be run again or is required to run at all.

The following attributes control this behavior:

  • creates: checks if a directory or file exists
  • onlyif or unless: execute checks to verify idempotency
  • refreshonly: only run the exec if it is triggered by another reosurce

What you have done

exec { '/bin/apt update':
}

What you should have done

exec { '/bin/apt update':
  refreshonly => true,
}

Disabling the check

To disable this check, you can add --no-exec_idempotency-check to your puppet-lint command line.

$ puppet-lint --no-exec_idempotency-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_idempotency')

License

TBD

Release information

To make a new release, please do:

  • update the version in the gemspec file
  • Install gems with bundle install --with release --path .vendor
  • generate the changelog with bundle exec rake changelog
  • Check if the new version matches the closed issues/PRs in the changelog
  • Create a PR with it
  • After it got merged, push a tag. GitHub actions will do the actual release to rubygems and GitHub Packages

About

Lint check to verify if an exec resource has idempotency attributes set.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages