Add generic Rakefile
This commit is contained in:
parent
056c3db7e4
commit
ca60a9dcf5
1 changed files with 40 additions and 0 deletions
40
Rakefile
Normal file
40
Rakefile
Normal file
|
@ -0,0 +1,40 @@
|
|||
namespace :validate do
|
||||
def validate(files)
|
||||
sh("puppet parser validate #{files.join(' ')}")
|
||||
end
|
||||
|
||||
def lint(files)
|
||||
files.each do |f|
|
||||
sh("puppet-lint #{f}")
|
||||
end
|
||||
end
|
||||
|
||||
def erb(files)
|
||||
files.each do |f|
|
||||
sh("erb -x -T '-' #{f} | ruby -c")
|
||||
end
|
||||
end
|
||||
|
||||
def manifests
|
||||
Dir.glob('manifests/**/*').select { |f| !File.directory? f }
|
||||
end
|
||||
|
||||
def templates
|
||||
Dir.glob('templates/**/*').select { |f| !File.directory? f }
|
||||
end
|
||||
|
||||
desc 'Validate all puppet manifests'
|
||||
task :pp do
|
||||
validate manifests
|
||||
end
|
||||
|
||||
desc 'Puppet Lint on all manifests'
|
||||
task :lint do
|
||||
lint manifests
|
||||
end
|
||||
|
||||
desc 'Validate all puppet templates'
|
||||
task :erb do
|
||||
erb templates
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue