Add generic Rakefile

This commit is contained in:
Andrew Tomaka 2013-06-24 01:04:43 -04:00
parent 056c3db7e4
commit ca60a9dcf5

40
Rakefile Normal file
View 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