class Kitchen::Provisioner::ChefZeroCapture
chef-zero provisioner intended for use with `chef capture`.
This provisioner does not do any cookbook dependency resolution and will not pull in external cookbooks. All cookbooks or cookbook artifacts + policy data as captured from the live node and are expected to be available for chef-zero to provide to the client.
Public Instance Methods
create_sandbox()
click to toggle source
# File lib/kitchen/provisioner/chef_zero_capture.rb, line 59 def create_sandbox # We have to invoke the the true Base create_sandbox because it does setup that # we want. However, we do not want to invoke the create_sandbox inherited from # ChefZero/ChefBase - those will create and populate a ChefCommonSandbox instead # of a ChefZeroCaptureSandbox. m = Base.instance_method(:create_sandbox).bind(self) m.call # These behaviors from super we _do_ want, so we need to copy them here. prepare_validation_pem prepare_config_rb ChefZeroCaptureSandbox.new(config, sandbox_path, instance).populate end
default_config_rb()
click to toggle source
Overriding the private ProviderChefZero#default_config_rb so that we can add additional configuration required for chef-zero to be able to locate our policies/, policy groups, and cookbook artifacts at run-time.
Calls superclass method
# File lib/kitchen/provisioner/chef_zero_capture.rb, line 77 def default_config_rb cfg = super # Need to tell chef-zero about our additional config. root = config[:root_path].gsub("$env:TEMP", "\#{ENV['TEMP']\}") cfg[:policies_path] = remote_path_join(root, config[:policies_path]) cfg[:policy_groups_path] = remote_path_join(root, config[:policy_groups_path]) cfg[:cookbook_artifacts_path] = remote_path_join(root, config[:cookbook_artifacts_path]) cfg end
load_needed_dependencies!()
click to toggle source
This will load policyfile/berkshelf. We don't want either - the client resolves all dependencies from chef-zero, exactly as prepped in the captured repository.
# File lib/kitchen/provisioner/chef_zero_capture.rb, line 57 def load_needed_dependencies!; end