Module: Beaker::Options::Presets
- Defined in:
- lib/beaker/options/presets.rb
Overview
A set of functions representing the environment variables and preset argument values to be incorporated into the Beaker options Object.
Class Method Summary collapse
-
.env_vars ⇒ OptionsHash
Generates an OptionsHash of the environment variables of interest to Beaker.
-
.presets ⇒ OptionsHash
Generates an OptionsHash of preset values for arguments supported by Beaker.
Class Method Details
.env_vars ⇒ OptionsHash
Generates an OptionsHash of the environment variables of interest to Beaker
Currently supports:
consoleport, IS_PE, pe_dist_dir, pe_version_file, pe_version_file_win, pe_ver
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/beaker/options/presets.rb', line 15 def self.env_vars h = Beaker::Options::OptionsHash.new h.merge({ :consoleport => ENV['consoleport'] ? ENV['consoleport'].to_i : nil, :type => ENV['IS_PE'] ? 'pe' : nil, :pe_dir => ENV['pe_dist_dir'], :pe_version_file => ENV['pe_version_file'], :pe_version_file_win => ENV['pe_version_file'], :pe_ver => ENV['pe_ver'], :project => ENV['BEAKER_project'], :department => ENV['BEAKER_department'], }.delete_if {|key, value| value.nil? or value.empty? }) end |
.presets ⇒ OptionsHash
Generates an OptionsHash of preset values for arguments supported by Beaker
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/beaker/options/presets.rb', line 32 def self.presets h = Beaker::Options::OptionsHash.new h.merge({ :project => 'Beaker', :department => ENV['USER'] || ENV['USERNAME'] || 'unknown', :log_level => 'verbose', :trace_limit => 10, :hosts_file => 'sample.cfg', :options_file => nil, :type => 'pe', :provision => true, :preserve_hosts => 'never', :root_keys => false, :quiet => false, :xml => false, :color => true, :dry_run => false, :timeout => 300, :fail_mode => 'slow', :timesync => false, :repo_proxy => false, :add_el_extras => false, :add_master_entry => false, :consoleport => 443, :pe_dir => '/opt/enterprise/dists', :pe_version_file => 'LATEST', :pe_version_file_win => 'LATEST-win', :dot_fog => File.join(ENV['HOME'], '.fog'), :ec2_yaml => 'config/image_templates/ec2.yaml', :help => false, :ssh => { :config => false, :paranoid => false, :timeout => 300, :auth_methods => ["publickey"], :port => 22, :forward_agent => true, :keys => ["#{ENV['HOME']}/.ssh/id_rsa"], :user_known_hosts_file => "#{ENV['HOME']}/.ssh/known_hosts", } }) end |