Class: Kitchen::Provisioner::Chef::CommonSandbox Private

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/kitchen/provisioner/chef/common_sandbox.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Internal object to manage common sandbox preparation for Chef-related provisioners.

Author:

Instance Method Summary collapse

Methods included from Logging

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

Constructor Details

#initialize(config, sandbox_path, instance) ⇒ CommonSandbox

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Constructs a new object, taking config, a sandbox path, and an instance.

Parameters:

  • config (Hash)

    configuration hash

  • sandbox_path (String)

    path to local sandbox directory

  • instance (Instance)

    an instance



37
38
39
40
41
# File 'lib/kitchen/provisioner/chef/common_sandbox.rb', line 37

def initialize(config, sandbox_path, instance)
  @config = config
  @sandbox_path = sandbox_path
  @instance = instance
end

Instance Method Details

#populateObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Populate the sandbox.



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/kitchen/provisioner/chef/common_sandbox.rb', line 44

def populate
  prepare_json
  prepare_cache
  prepare_cookbooks
  prepare(:data)
  prepare(:data_bags)
  prepare(:environments)
  prepare(:nodes)
  prepare(:roles)
  prepare(:clients)
  prepare(
    :secret,
    type: :file,
    dest_name: "encrypted_data_bag_secret",
    key_name: :encrypted_data_bag_secret_key_path
  )
end