Class: BeakerAnswers::Version32 Private

Inherits:
Version30 show all
Defined in:
lib/beaker-answers/versions/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

Constant Summary

Constants inherited from Answers

Answers::DEFAULT_ANSWERS, Answers::DEFAULT_FORMAT, Answers::DEFAULT_HIERA_ANSWERS

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Version30

#host_answers

Methods inherited from Answers

#answer_for, #answer_hiera, #answer_string, #answers, create, #get_defaults_or_answers, #initialize, #installer_configuration_string, #only_host_with_role, supported_upgrade_versions, supported_versions

Constructor Details

This class inherits a constructor from BeakerAnswers::Answers

Class Method Details

.pe_version_matcherObject

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.

The version of PE that this set of answers is appropriate for



9
10
11
# File 'lib/beaker-answers/versions/version32.rb', line 9

def self.pe_version_matcher
  /\A3\.(2|3)/
end

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.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/beaker-answers/versions/version32.rb', line 17

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.to_s
  end

  # do we want to check for updates?
  pe_check_for_updates = answer_for(@options, :q_pe_check_for_updates, 'n')
  the_answers[dashboard.name][:q_pe_check_for_updates] = pe_check_for_updates
  the_answers[master.name][:q_pe_check_for_updates] = pe_check_for_updates

  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