Class: BeakerAnswers::Version34 Private

Inherits:
Version32 show all
Defined in:
lib/beaker-answers/versions/version34.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.4

Direct Known Subclasses

Version38

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/version34.rb', line 9

def self.pe_version_matcher
  /\A3\.(4|7)/
end

Instance Method Details

#generate_answersObject

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.



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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/beaker-answers/versions/version34.rb', line 13

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

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

  the_answers = super

  classifier_database_user     = answer_for(@options, :q_classifier_database_user, 'DFGhjlkj')
  classifier_database_name     = answer_for(@options, :q_classifier_database_name, 'pe-classifier')
  classifier_database_password = "'#{answer_for(@options, :q_classifier_database_password)}'"
  activity_database_user       = answer_for(@options, :q_activity_database_user, 'adsfglkj')
  activity_database_name       = answer_for(@options, :q_activity_database_name, 'pe-activity')
  activity_database_password   = "'#{answer_for(@options, :q_activity_database_password)}'"
  rbac_database_user           = answer_for(@options, :q_rbac_database_user, 'RbhNBklm')
  rbac_database_name           = answer_for(@options, :q_rbac_database_name, 'pe-rbac')
  rbac_database_password       = "'#{answer_for(@options, :q_rbac_database_password)}'"

  console_services_hash = {
    :q_classifier_database_user     => classifier_database_user,
    :q_classifier_database_name     => classifier_database_name,
    :q_classifier_database_password => classifier_database_password,
    :q_activity_database_user       => activity_database_user,
    :q_activity_database_name       => activity_database_name,
    :q_activity_database_password   => activity_database_password,
    :q_rbac_database_user           => rbac_database_user,
    :q_rbac_database_name           => rbac_database_name,
    :q_rbac_database_password       => rbac_database_password,
  }

  # If we're installing or upgrading from a non-RBAC version, set the 'admin' password
  if @options[:type] == :upgrade && @options[:set_console_password]
    dashboard_password = "'#{answer_for(@options, :q_puppet_enterpriseconsole_auth_password)}'"
    the_answers[dashboard.name][:q_puppet_enterpriseconsole_auth_password] = dashboard_password
  end

  the_answers[dashboard.name].merge!(console_services_hash)
  the_answers[database.name].merge!(console_services_hash)

  return the_answers
end