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_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, #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.
50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/pe_build/config/pe_bootstrap.rb', line 50 def initialize super @role = UNSET_VALUE @verbose = UNSET_VALUE @master = UNSET_VALUE @answer_file = UNSET_VALUE @relocate_manifests = UNSET_VALUE @autosign = UNSET_VALUE end |
Instance Attribute Details
#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.
45 46 47 |
# File 'lib/pe_build/config/pe_bootstrap.rb', line 45 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.
32 33 34 |
# File 'lib/pe_build/config/pe_bootstrap.rb', line 32 def relocate_manifests @relocate_manifests end |
#role ⇒ Symbol
Returns The type of the PE installation role. One of [:master, :agent].
23 24 25 |
# File 'lib/pe_build/config/pe_bootstrap.rb', line 23 def role @role end |
#verbose ⇒ TrueClass, FalseClass
Returns if stdout will be displayed when installing.
18 19 20 |
# File 'lib/pe_build/config/pe_bootstrap.rb', line 18 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
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/pe_build/config/pe_bootstrap.rb', line 69 def finalize! set_default :@role, :agent set_default :@verbose, true set_default :@master, 'master' set_default :@answer_file, nil 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 end |
#validate(machine) ⇒ Object
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/pe_build/config/pe_bootstrap.rb', line 88 def validate(machine) h = super errors = [] validate_role(errors, machine) validate_verbose(errors, machine) validate_master(errors, machine) validate_answer_file(errors, machine) validate_relocate_manifests(errors, machine) validate_autosign(errors, machine) errors |= h.values.flatten {"PE Bootstrap" => errors} end |