Class: Kitchen::Terraform::Transport::Connection
- Inherits:
-
Kitchen::Transport::Exec::Connection
- Object
- Kitchen::Transport::Exec::Connection
- Kitchen::Terraform::Transport::Connection
- Defined in:
- lib/kitchen/terraform/transport/connection.rb
Overview
Terraform commands are run by shelling out and using the command-line interface.
The shell out environment includes the TF_IN_AUTOMATION environment variable as specified by the Running Terraform in Automation guide.
Instance Method Summary collapse
-
#execute(command) ⇒ String
#execute executes a Terraform CLI command on the local host.
-
#run_command(command, options = {}) ⇒ String
#run_command executes a command in a subshell on the local running system.
Instance Method Details
#execute(command) ⇒ String
#execute executes a Terraform CLI command on the local host.
33 34 35 36 37 |
# File 'lib/kitchen/terraform/transport/connection.rb', line 33 def execute(command) super "#{client} #{command}" stdout end |
#run_command(command, options = {}) ⇒ String
#run_command executes a command in a subshell on the local running system.
46 47 48 49 50 51 52 |
# File 'lib/kitchen/terraform/transport/connection.rb', line 46 def run_command(command, = {}) self.stdout = super command, .merge( cwd: root_module_directory, environment: environment.merge("LC_ALL" => nil, "TF_IN_AUTOMATION" => "true"), timeout: command_timeout, ) end |