Last active
April 23, 2020 11:48
-
-
Save raphink/7ac09e3bfb4014e1a80e5c14cfbd2a77 to your computer and use it in GitHub Desktop.
Puppet Lint/Ghostbuster Blog Post
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source ENV['GEM_SOURCE'] || "https://rubygems.org" | |
group :development, :test do | |
gem 'rake', :require => false | |
gem 'puppet-lint', :require => false | |
# Other lint plugins (optional) | |
gem 'puppet-lint-spaceship_operator_without_tag-check', :require => false | |
gem 'puppet-lint-unquoted_string-check', :require => false | |
gem 'puppet-lint-undef_in_function-check', :require => false | |
gem 'puppet-lint-leading_zero-check', :require => false | |
gem 'puppet-lint-trailing_comma-check', :require => false | |
gem 'puppet-lint-file_ensure-check', :require => false | |
gem 'puppet-lint-version_comparison-check', :require => false | |
# You can also use the voxpupuli-test gem, | |
# which pulls rake, puppet-lint & plugins as dependencies | |
gem 'voxpupuli-test', :require => false | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source ENV['GEM_SOURCE'] || "https://rubygems.org" | |
group :development, :test do | |
gem 'rake', :require => false | |
gem 'puppet-lint', :require => false, | |
:git => 'https://github.com/raphink/puppet-lint', | |
:ref => '2cac4fb' # Includes patch for whitelisting checks | |
gem 'puppet-ghostbuster', :require => false | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source ENV['GEM_SOURCE'] || "https://rubygems.org" | |
group :development, :test do | |
gem 'voxpupuli-test', :require => false | |
gem 'onceover', :require => false | |
gem 'onceover-codequality', :require => false | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PuppetLint::RakeTask.new :ghostbuster do |config| | |
config.pattern = ['./site/**/*'] | |
config.only_checks = [ | |
'ghostbuster_classes', | |
'ghostbuster_defines', | |
'ghostbuster_facts', | |
'ghostbuster_files', | |
'ghostbuster_functions', | |
'ghostbuster_hiera_files', | |
'ghostbuster_templates', | |
'ghostbuster_types', | |
] | |
config.fail_on_warnings = true | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rake::Task[:lint].clear | |
PuppetLint::RakeTask.new :lint do |config| | |
config.ignore_paths = [ | |
'modules/**/*.pp', | |
'vendor/**/*', | |
] | |
config.disable_checks = [ | |
'80chars', | |
'documentation', | |
] | |
config.fail_on_warnings = true | |
config.fix = true if ENV['PUPPETLINT_FIX'] == 'yes' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ bundle install --path vendor/bundle | |
$ bundle exec rake lint |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PUPPETDB_URL: https://puppetdb.example.com:8081 | |
PUPPETDB_CERT_FILE: !var:file path/to/secret:cert | |
PUPPETDB_KEY_FILE: !var:file path/to/secret:key | |
PUPPETDB_CACERT_FILE: !var:file path/to/secret:cacert | |
HIERA_YAML_PATH: ./hiera.yaml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment