Skip to content

Latest commit

 

History

History
80 lines (55 loc) · 2.86 KB

File metadata and controls

80 lines (55 loc) · 2.86 KB

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