2016-01-25 16:42:27 +01:00
|
|
|
require 'puppet_blacksmith/rake_tasks'
|
2014-02-09 07:21:34 +01:00
|
|
|
require 'puppet-lint/tasks/puppet-lint'
|
2016-01-25 16:42:27 +01:00
|
|
|
require 'puppetlabs_spec_helper/rake_tasks'
|
2014-02-09 07:22:47 +01:00
|
|
|
|
2015-02-12 01:43:14 +01:00
|
|
|
PuppetLint.configuration.fail_on_warnings = true
|
2014-12-08 19:23:17 +01:00
|
|
|
PuppetLint.configuration.send('relative')
|
2016-06-30 12:53:46 +02:00
|
|
|
PuppetLint.configuration.send('disable_140chars')
|
2014-06-26 02:23:12 +02:00
|
|
|
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
|
|
|
|
PuppetLint.configuration.send('disable_documentation')
|
2014-02-09 07:22:47 +01:00
|
|
|
PuppetLint.configuration.send('disable_single_quote_string_with_variables')
|
2016-06-30 12:53:46 +02:00
|
|
|
PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp", "bundle/**/*", "vendor/**/*"]
|
2016-02-16 16:59:57 +01:00
|
|
|
|
|
|
|
desc 'Generate pooler nodesets'
|
|
|
|
task :gen_nodeset do
|
|
|
|
require 'beaker-hostgenerator'
|
|
|
|
require 'securerandom'
|
|
|
|
require 'fileutils'
|
|
|
|
|
|
|
|
agent_target = ENV['TEST_TARGET']
|
|
|
|
if ! agent_target
|
|
|
|
STDERR.puts 'TEST_TARGET environment variable is not set'
|
|
|
|
STDERR.puts 'setting to default value of "redhat-64default."'
|
|
|
|
agent_target = 'redhat-64default.'
|
|
|
|
end
|
|
|
|
|
|
|
|
master_target = ENV['MASTER_TEST_TARGET']
|
|
|
|
if ! master_target
|
|
|
|
STDERR.puts 'MASTER_TEST_TARGET environment variable is not set'
|
|
|
|
STDERR.puts 'setting to default value of "redhat7-64mdcl"'
|
|
|
|
master_target = 'redhat7-64mdcl'
|
|
|
|
end
|
|
|
|
|
|
|
|
targets = "#{master_target}-#{agent_target}"
|
|
|
|
cli = BeakerHostGenerator::CLI.new([targets])
|
|
|
|
nodeset_dir = "tmp/nodesets"
|
|
|
|
nodeset = "#{nodeset_dir}/#{targets}-#{SecureRandom.uuid}.yaml"
|
|
|
|
FileUtils.mkdir_p(nodeset_dir)
|
|
|
|
File.open(nodeset, 'w') do |fh|
|
|
|
|
fh.print(cli.execute)
|
|
|
|
end
|
|
|
|
puts nodeset
|
|
|
|
end
|