Module: Kitchen::Terraform::ConfigAttribute::Client
- Extended by:
- Kitchen::Terraform::ConfigAttributeCacher
- Included in:
- Driver::Terraform, Kitchen::Transport::Terraform
- Defined in:
- lib/kitchen/terraform/config_attribute/client.rb
Overview
This attribute contains the pathname of the Terraform client to be used by Kitchen-Terraform.
If the value is not an absolute pathname or a relative pathname then Kitchen-Terraform will attempt to find the value in the directories of the ) PATH.
The pathname of any executable file which implements the interfaces of the following Terraform client commands may be specified: apply; destroy; get; init; validate; workspace.
- Type
- Required
-
False
- Default
-
terraform
- Example
-
client: /usr/local/bin/terraform
- Example
-
client: ./bin/terraform
- Example
-
client: terraform
Class Method Summary collapse
-
.included(plugin_class) ⇒ self
.included is a callback to define the configuration attribute which is invoked when this module is included in a plugin class.
-
.to_sym ⇒ Symbol
The symbol corresponding to this attribute.
Instance Method Summary collapse
-
#config_client_default_value ⇒ String
</code>“terraform”</code>.
-
#doctor_config_client ⇒ Boolean
#doctor_config_client validates the client configuration.
Methods included from Kitchen::Terraform::ConfigAttributeCacher
Class Method Details
.included(plugin_class) ⇒ self
.included is a callback to define the configuration attribute which is invoked when this module is included in a plugin class.
47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/kitchen/terraform/config_attribute/client.rb', line 47 def included(plugin_class) ::Kitchen::Terraform::ConfigAttributeDefiner.new( attribute: self, schema: ::Kitchen::Terraform::ConfigAttributeContract::String.new, ).define plugin_class: plugin_class plugin_class. to_sym do |plugin| !::TTY::Which.exist? plugin[to_sym] end self end |
.to_sym ⇒ Symbol
Returns the symbol corresponding to this attribute.
60 61 62 |
# File 'lib/kitchen/terraform/config_attribute/client.rb', line 60 def to_sym :client end |
Instance Method Details
#config_client_default_value ⇒ String
Returns </code>“terraform”</code>.
68 69 70 |
# File 'lib/kitchen/terraform/config_attribute/client.rb', line 68 def config_client_default_value "terraform" end |
#doctor_config_client ⇒ Boolean
#doctor_config_client validates the client configuration.
75 76 77 78 79 80 81 82 83 84 |
# File 'lib/kitchen/terraform/config_attribute/client.rb', line 75 def doctor_config_client errors = false if !::TTY::Which.exist? config_client errors = true logger.error "client '#{config_client}' is not executable or does not exist" end errors end |