source: other-projects/hathitrust/vagrant-hadoop-cluster/trunk/modules/stdlib/Rakefile@ 30903

Last change on this file since 30903 was 30903, checked in by davidb, 7 years ago

Vagrant provisioning files for a 4-node Hadoop cluster. See README.txt for more details

File size: 1.2 KB
Line 
1require 'puppet_blacksmith/rake_tasks'
2require 'puppet-lint/tasks/puppet-lint'
3require 'puppetlabs_spec_helper/rake_tasks'
4
5PuppetLint.configuration.send('relative')
6PuppetLint.configuration.send('disable_documentation')
7PuppetLint.configuration.send('disable_single_quote_string_with_variables')
8
9desc 'Generate pooler nodesets'
10task :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
38end
Note: See TracBrowser for help on using the repository browser.