Class: PEBuild::Config::PEAgent
- Inherits:
-
Object
- Object
- PEBuild::Config::PEAgent
- Defined in:
- lib/pe_build/config/pe_agent.rb
Overview
Configuration for PE Agent provisioners
Constant Summary collapse
- MINIMUM_VERSION =
The minimum PE Version supported by this provisioner.
'2015.2.0'
Instance Attribute Summary collapse
-
#agent_type ⇒ String
This allows for configuring the agent as an infrastructure component.
-
#autopurge ⇒ true, false
If true, and #master_vm is set, the agent's certificate and data will be purged from the master VM if the agent is destroyed by Vagrant.
-
#autosign ⇒ true, false
If true, and #master_vm is set, the agent's certificate will be signed on the master VM.
-
#master ⇒ String
The DNS hostname of the Puppet master for this node.
-
#master_vm ⇒ String
The name of a Vagrant VM to use as the master.
-
#version ⇒ String
string of the form
x.y.x[-optional-arbitrary-stuff]
or the stringcurrent
.
Instance Method Summary collapse
- #finalize! ⇒ Object
-
#initialize ⇒ PEAgent
constructor
A new instance of PEAgent.
- #validate(machine) ⇒ Object
Constructor Details
#initialize ⇒ PEAgent
Returns a new instance of PEAgent.
50 51 52 53 54 55 56 57 |
# File 'lib/pe_build/config/pe_agent.rb', line 50 def initialize @autosign = UNSET_VALUE @autopurge = UNSET_VALUE @master = UNSET_VALUE @master_vm = UNSET_VALUE @version = UNSET_VALUE @agent_type = UNSET_VALUE end |
Instance Attribute Details
#agent_type ⇒ String
This allows for configuring the agent as an infrastructure component.
May be either compile
, replica, or
agent.
Defaults to
agent`.
48 49 50 |
# File 'lib/pe_build/config/pe_agent.rb', line 48 def agent_type @agent_type end |
#autopurge ⇒ true, false
If true, and #master_vm is set, the agent's certificate and data will be purged from the master VM if the agent is destroyed by Vagrant.
24 25 26 |
# File 'lib/pe_build/config/pe_agent.rb', line 24 def autopurge @autopurge end |
#autosign ⇒ true, false
If true, and #master_vm is set, the agent's certificate will be signed on the master VM.
16 17 18 |
# File 'lib/pe_build/config/pe_agent.rb', line 16 def autosign @autosign end |
#master ⇒ String
Returns The DNS hostname of the Puppet master for this node. If #master_vm is set, the hostname of that machine will be used as a default. If the hostname is unset, the name of the VM will be used as a secondary default.
31 32 33 |
# File 'lib/pe_build/config/pe_agent.rb', line 31 def master @master end |
#master_vm ⇒ String
Returns The name of a Vagrant VM to use as the master.
35 36 37 |
# File 'lib/pe_build/config/pe_agent.rb', line 35 def master_vm @master_vm end |
#version ⇒ String
string of the form x.y.x[-optional-arbitrary-stuff]
or the string
current
. Defaults to current
.
41 42 43 |
# File 'lib/pe_build/config/pe_agent.rb', line 41 def version @version end |
Instance Method Details
#finalize! ⇒ Object
59 60 61 62 63 64 65 66 |
# File 'lib/pe_build/config/pe_agent.rb', line 59 def finalize! @master = nil if @master == UNSET_VALUE @master_vm = nil if @master_vm == UNSET_VALUE @autosign = (not @master_vm.nil?) if @autosign == UNSET_VALUE @autopurge = (not @master_vm.nil?) if @autopurge == UNSET_VALUE @version = 'current' if @version == UNSET_VALUE @agent_type = 'agent' if @agent_type == UNSET_VALUE end |
#validate(machine) ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/pe_build/config/pe_agent.rb', line 68 def validate(machine) errors = _detected_errors if @master.nil? && @master_vm.nil? errors << I18n.t('pebuild.config.pe_agent.errors.no_master') end validate_master_vm!(errors, machine) validate_version!(errors, machine) validate_agent_type!(errors, machine) {'pe_agent provisioner' => errors} end |