Sha256: 2c2fe44423080cf232a63934ee06b51d3453ed0a7dfc80c9b47c8429afdb76d8

Contents?: true

Size: 1.65 KB

Versions: 43

Compression:

Stored size: 1.65 KB

Contents

require 'beaker-answers/versions/version30'
module BeakerAnswers
  # This class provides answer file information for PE version 3.2
  #
  # @api private
  class Version32 < Version30

    # The version of PE that this set of answers is appropriate for
    def self.pe_version_matcher
      /\A3\.(2|3)/
    end

    # Return answer data for all hosts.
    #
    # @return [Hash] A hash (keyed from hosts) containing hashes of answer file
    #   data.
    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
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
beaker-answers-1.0.0 lib/beaker-answers/versions/version32.rb
beaker-answers-0.29.0 lib/beaker-answers/versions/version32.rb
beaker-answers-0.28.0 lib/beaker-answers/versions/version32.rb
beaker-answers-0.27.0 lib/beaker-answers/versions/version32.rb
beaker-answers-0.26.3 lib/beaker-answers/versions/version32.rb
beaker-answers-0.26.2 lib/beaker-answers/versions/version32.rb
beaker-answers-0.26.1 lib/beaker-answers/versions/version32.rb
beaker-answers-0.26.0 lib/beaker-answers/versions/version32.rb
beaker-answers-0.25.0 lib/beaker-answers/versions/version32.rb
beaker-answers-0.24.0 lib/beaker-answers/versions/version32.rb
beaker-answers-0.23.0 lib/beaker-answers/versions/version32.rb
beaker-answers-0.22.0 lib/beaker-answers/versions/version32.rb
beaker-answers-0.21.0 lib/beaker-answers/versions/version32.rb
beaker-answers-0.20.0 lib/beaker-answers/versions/version32.rb
beaker-answers-0.19.0 lib/beaker-answers/versions/version32.rb
beaker-answers-0.18.0 lib/beaker-answers/versions/version32.rb
beaker-answers-0.17.0 lib/beaker-answers/versions/version32.rb
beaker-answers-0.16.0 lib/beaker-answers/versions/version32.rb
beaker-answers-0.15.0 lib/beaker-answers/versions/version32.rb
beaker-answers-0.14.0 lib/beaker-answers/versions/version32.rb