Module: Beaker::Answers
- Defined in:
- lib/beaker/answers.rb,
lib/beaker/answers/version20.rb,
lib/beaker/answers/version28.rb,
lib/beaker/answers/version30.rb,
lib/beaker/answers/version32.rb
Overview
This module provides static methods for accessing PE answer file information.
Defined Under Namespace
Modules: Version20, Version28, Version30, Version32
Class Method Summary collapse
-
.answer_string(host, answers) ⇒ String
This converts a data hash provided by answers, and returns a Puppet Enterprise compatible answer file ready for use.
-
.answers(version, hosts, master_certname, options) ⇒ Hash
When given a Puppet Enterprise version, a list of hosts and other qualifying data this method will return a hash (keyed from the hosts) of default Puppet Enterprise answer file data hashes.
Class Method Details
.answer_string(host, answers) ⇒ String
This converts a data hash provided by answers, and returns a Puppet Enterprise compatible answer file ready for use.
end
55 56 57 |
# File 'lib/beaker/answers.rb', line 55 def self.answer_string(host, answers) answers[host.name].map { |k,v| "#{k}=#{v}" }.join("\n") end |
.answers(version, hosts, master_certname, options) ⇒ Hash
When given a Puppet Enterprise version, a list of hosts and other qualifying data this method will return a hash (keyed from the hosts) of default Puppet Enterprise answer file data hashes.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/beaker/answers.rb', line 25 def self.answers(version, hosts, master_certname, ) case version when /\A3\.2/ Version32.answers(hosts, master_certname, ) when /\A3\.1/ Version30.answers(hosts, master_certname, ) when /\A3\.0/ Version30.answers(hosts, master_certname, ) when /\A2\.8/ Version28.answers(hosts, master_certname, ) when /\A2\.0/ Version20.answers(hosts, master_certname, ) else raise NotImplementedError, "Don't know how to generate answers for #{version}" end end |