Class: Beaker::Version32 Private

Inherits:
Version30 show all
Defined in:
lib/beaker/answers/version32.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

This class provides answer file information for PE version 3.2

Direct Known Subclasses

Version34

Instance Method Summary collapse

Methods inherited from Version30

#host_answers

Methods inherited from Answers

#answer_for, #answer_string, #answers, create, #initialize

Constructor Details

This class inherits a constructor from Beaker::Answers

Instance Method Details

#generate_answersHash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Return answer data for all hosts.

Returns:

  • (Hash)

    A hash (keyed from hosts) containing hashes of answer file data.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/beaker/answers/version32.rb', line 12

def generate_answers
  masterless = @options[:masterless]
  return super if masterless

  dashboard = only_host_with_role(@hosts, 'dashboard')
  database = only_host_with_role(@hosts, 'database')
  master = only_host_with_role(@hosts, 'master')

  the_answers = super
  if dashboard != master
    # in 3.2, dashboard needs the master certname
    the_answers[dashboard.name][:q_puppetmaster_certname] = master
  end

  if @options[:type] == :upgrade && dashboard != database
    # In a split configuration, there is no way for the upgrader
    # to know how much disk space is available for the database
    # migration. We tell it to continue on, because we're
    # awesome.
    the_answers[dashboard.name][:q_upgrade_with_unknown_disk_space] = 'y'
  end
  @hosts.each do |h|
    h[:answers] = the_answers[h.name]
  end
  return the_answers
end