Class: Kitchen::Terraform::System
- Inherits:
-
Object
- Object
- Kitchen::Terraform::System
- Defined in:
- lib/kitchen/terraform/system.rb
Overview
System is the class of objects which are verified by the Terraform Verifier.
Instance Method Summary collapse
-
#initialize(configuration_attributes:, logger:) ⇒ Kitchen::Terraform::System
constructor
#initialize prepares a new instance of the class.
-
#to_s ⇒ String
A string representation of the system.
-
#verify(fail_fast:, outputs:, variables:) ⇒ self
#verify verifies the system by executing InSpec.
Constructor Details
#initialize(configuration_attributes:, logger:) ⇒ Kitchen::Terraform::System
#initialize prepares a new instance of the class.
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/kitchen/terraform/system.rb', line 40 def initialize(configuration_attributes:, logger:) self.attrs = {} self.attrs_outputs = configuration_attributes.fetch :attrs_outputs do {} end.dup self.configuration_attributes = configuration_attributes self.hosts = configuration_attributes.fetch :hosts do [] end.dup self.logger = logger end |
Instance Method Details
#to_s ⇒ String
Returns a string representation of the system.
53 54 55 |
# File 'lib/kitchen/terraform/system.rb', line 53 def to_s configuration_attributes.fetch(:name).dup end |
#verify(fail_fast:, outputs:, variables:) ⇒ self
#verify verifies the system by executing InSpec.
64 65 66 67 68 69 70 |
# File 'lib/kitchen/terraform/system.rb', line 64 def verify(fail_fast:, outputs:, variables:) resolve_and_execute fail_fast: fail_fast, outputs: outputs, variables: variables self rescue ::Kitchen::TransientFailure => error raise ::Kitchen::TransientFailure, "Verifying the '#{self}' system failed:\n\t#{error.}" end |