Revision e5bb2ac389fc2d0d5730c265c95d4034ee13dcc1 authored by Faidon Liambotis on 29 May 2017, 21:24:04 UTC, committed by Faidon Liambotis on 08 June 2017, 23:23:04 UTC
Instead of hardcoding eth0 and eth1 in a bunch of places, use
$monitor_iface (for eth0) and $data_iface (eth1) as parameters to
role::labs::nfs::secondary and pass them to included classes as needed.

We could use $facts['interface_primary'] for $monitor_iface (instead of
eth0), but since we have to hardcode the value for $data_iface, that
would be of limited value.

Change-Id: I761da8f8d2e07e596c2d81a69d48543dc88ece2a
1 parent 96c5de1
Raw File
Rakefile
require 'puppet_blacksmith/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
require 'puppetlabs_spec_helper/rake_tasks'

PuppetLint.configuration.send('relative')
PuppetLint.configuration.send('disable_documentation')
PuppetLint.configuration.send('disable_single_quote_string_with_variables')

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
back to top