Last change
on this file since 30960 was 30960, checked in by davidb, 8 years ago |
Switch to using Puppet to provision machine. Strongly based on files developed for spark-hdfs cluster
|
File size:
1.2 KB
|
Rev | Line | |
---|
[30960] | 1 | require 'puppet_blacksmith/rake_tasks'
|
---|
| 2 | require 'puppet-lint/tasks/puppet-lint'
|
---|
| 3 | require 'puppetlabs_spec_helper/rake_tasks'
|
---|
| 4 |
|
---|
| 5 | PuppetLint.configuration.send('relative')
|
---|
| 6 | PuppetLint.configuration.send('disable_documentation')
|
---|
| 7 | PuppetLint.configuration.send('disable_single_quote_string_with_variables')
|
---|
| 8 |
|
---|
| 9 | desc 'Generate pooler nodesets'
|
---|
| 10 | task :gen_nodeset do
|
---|
| 11 | require 'beaker-hostgenerator'
|
---|
| 12 | require 'securerandom'
|
---|
| 13 | require 'fileutils'
|
---|
| 14 |
|
---|
| 15 | agent_target = ENV['TEST_TARGET']
|
---|
| 16 | if ! agent_target
|
---|
| 17 | STDERR.puts 'TEST_TARGET environment variable is not set'
|
---|
| 18 | STDERR.puts 'setting to default value of "redhat-64default."'
|
---|
| 19 | agent_target = 'redhat-64default.'
|
---|
| 20 | end
|
---|
| 21 |
|
---|
| 22 | master_target = ENV['MASTER_TEST_TARGET']
|
---|
| 23 | if ! master_target
|
---|
| 24 | STDERR.puts 'MASTER_TEST_TARGET environment variable is not set'
|
---|
| 25 | STDERR.puts 'setting to default value of "redhat7-64mdcl"'
|
---|
| 26 | master_target = 'redhat7-64mdcl'
|
---|
| 27 | end
|
---|
| 28 |
|
---|
| 29 | targets = "#{master_target}-#{agent_target}"
|
---|
| 30 | cli = BeakerHostGenerator::CLI.new([targets])
|
---|
| 31 | nodeset_dir = "tmp/nodesets"
|
---|
| 32 | nodeset = "#{nodeset_dir}/#{targets}-#{SecureRandom.uuid}.yaml"
|
---|
| 33 | FileUtils.mkdir_p(nodeset_dir)
|
---|
| 34 | File.open(nodeset, 'w') do |fh|
|
---|
| 35 | fh.print(cli.execute)
|
---|
| 36 | end
|
---|
| 37 | puts nodeset
|
---|
| 38 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.