Class: PEBuild::Config::PEBootstrap
- Includes:
- PEBuild::ConfigDefault
- Defined in:
- lib/pe_build/config/pe_bootstrap.rb
Constant Summary collapse
- VALID_ROLES =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
[:agent, :master]
- VALID_AUTOSIGN_VALUES =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
[TrueClass, FalseClass, Array]
Instance Attribute Summary collapse
-
#answer_extras ⇒ Array<String>
An array of additional answer strings that will be appended to the answer file.
-
#answer_file ⇒ String
The path to a user specified answer_file file (Optional).
-
#autosign ⇒ TrueClass, ...
Configure the certificates that will be autosigned by the puppet master.
-
#master ⇒ String
The DNS hostname of the Puppet master for this node.
-
#relocate_manifests ⇒ TrueClass, FalseClass
If the puppet master should use manifests out of the vagrant directory.
-
#role ⇒ Symbol
The type of the PE installation role.
-
#verbose ⇒ TrueClass, FalseClass
If stdout will be displayed when installing.
Attributes inherited from Global
#download_root, #filename, #series, #shared_installer, #suffix, #version, #version_file
Instance Method Summary collapse
-
#finalize! ⇒ Object
Finalize all configuration variables.
-
#initialize ⇒ PEBootstrap
constructor
A new instance of PEBootstrap.
- #validate(machine) ⇒ Object
Constructor Details
#initialize ⇒ PEBootstrap
Returns a new instance of PEBootstrap.
56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/pe_build/config/pe_bootstrap.rb', line 56 def initialize super @role = UNSET_VALUE @verbose = UNSET_VALUE @master = UNSET_VALUE @answer_file = UNSET_VALUE @answer_extras = UNSET_VALUE @relocate_manifests = UNSET_VALUE @autosign = UNSET_VALUE end |
Instance Attribute Details
#answer_extras ⇒ Array<String>
Returns An array of additional answer strings that will be appended to the answer file. (Optional).
19 20 21 |
# File 'lib/pe_build/config/pe_bootstrap.rb', line 19 def answer_extras @answer_extras end |
#answer_file ⇒ String
Returns The path to a user specified answer_file file (Optional).
13 14 15 |
# File 'lib/pe_build/config/pe_bootstrap.rb', line 13 def answer_file @answer_file end |
#autosign ⇒ TrueClass, ...
Configure the certificates that will be autosigned by the puppet master.
51 52 53 |
# File 'lib/pe_build/config/pe_bootstrap.rb', line 51 def autosign @autosign end |
#master ⇒ String
Returns The DNS hostname of the Puppet master for this node.
8 9 10 |
# File 'lib/pe_build/config/pe_bootstrap.rb', line 8 def master @master end |
#relocate_manifests ⇒ TrueClass, FalseClass
Returns if the puppet master should use manifests out of the vagrant directory.
38 39 40 |
# File 'lib/pe_build/config/pe_bootstrap.rb', line 38 def relocate_manifests @relocate_manifests end |
#role ⇒ Symbol
Returns The type of the PE installation role. One of [:master, :agent].
29 30 31 |
# File 'lib/pe_build/config/pe_bootstrap.rb', line 29 def role @role end |
#verbose ⇒ TrueClass, FalseClass
Returns if stdout will be displayed when installing.
24 25 26 |
# File 'lib/pe_build/config/pe_bootstrap.rb', line 24 def verbose @verbose end |
Instance Method Details
#finalize! ⇒ Object
This does not finalize values for config options inherited from the global configuration; it's assumed that the late configuration merging in the provisioner will handle that.
Finalize all configuration variables
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/pe_build/config/pe_bootstrap.rb', line 76 def finalize! set_default :@role, nil set_default :@verbose, true set_default :@master, 'master' set_default :@answer_file, nil set_default :@answer_extras, [] set_default :@autosign, (@role == :master) set_default :@relocate_manifests, false # The value of role is normalized to a symbol so that users don't have to # know the underlying representation, and we don't have to cast everything # to a string and symbols later on. # # We also need to run this after a default was set, otherwise we'll try to # normalize UNSET_VALUE @role = @role.intern unless @role.nil? end |
#validate(machine) ⇒ Object
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/pe_build/config/pe_bootstrap.rb', line 96 def validate(machine) h = super errors = [] validate_role(errors, machine) validate_verbose(errors, machine) validate_master(errors, machine) validate_answer_file(errors, machine) validate_answer_extras(errors, machine) validate_relocate_manifests(errors, machine) validate_autosign(errors, machine) errors |= h.values.flatten {"PE Bootstrap" => errors} end |