Class: Kitchen::Provisioner::External

Inherits:
Base
  • Object
show all
Defined in:
lib/kitchen/provisioner/external.rb

Overview

Executes an external provisioner provider over the v1 stdio protocol.

Constant Summary collapse

PROTOCOL_VERSION =
"1.0".freeze
RESULT_STATUSES =
%w{passed failed skipped}.freeze
LOG_LEVELS =
%w{debug info warn error}.freeze
INTERNAL_CONFIG_KEYS =
%i{
  command provider pass_env kitchen_root test_base_path
}.freeze
REDACTED_KEYS =
%w{password ssh_http_proxy_password}.freeze

Instance Attribute Summary

Attributes included from Configurable

#instance

Instance Method Summary collapse

Methods inherited from Base

#check_license, #cleanup_sandbox, #create_sandbox, #doctor, #init_command, #initialize, #install_command, kitchen_provisioner_api_version, #prepare_command, #run_command, #sandbox_dirs, #sandbox_path

Methods included from Logging

#banner, #debug, #error, #fatal, #info, #warn

Methods included from Configurable

#[], #bourne_shell?, #calculate_path, #config_keys, #diagnose, #diagnose_plugin, #finalize_config!, included, #name, #powershell_shell?, #remote_path_join, #unix_os?, #verify_dependencies, #windows_os?

Constructor Details

This class inherits a constructor from Kitchen::Provisioner::Base

Instance Method Details

#call(state) ⇒ Object

Runs the provisioner on the instance.

rubocop:disable Metrics/AbcSize

Parameters:

  • state (Hash)

    mutable instance state

Raises:



46
47
48
49
50
51
# File 'lib/kitchen/provisioner/external.rb', line 46

def call(state)
  verify_capabilities
  validate_provider(state)
  result = run_provider(state)
  persist_provider_state(state, result)
end

#provider_name_from_commandObject



53
54
55
56
# File 'lib/kitchen/provisioner/external.rb', line 53

def provider_name_from_command
  first_part = Shellwords.split(config[:command].to_s).first.to_s
  File.basename(first_part).sub(/^kitchen-provider-/, "")
end