Method: Kitchen::Provisioner::ChefBase#init_command

Defined in:
lib/kitchen/provisioner/chef_base.rb

#init_commandString

Generates a command string which will perform any data initialization or configuration required after the provisioner software is installed but before the sandbox has been transferred to the instance. If no work is required, then ‘nil` will be returned.

Returns:

  • (String)

    a command string



312
313
314
315
316
317
318
319
320
321
322
323
324
325
# File 'lib/kitchen/provisioner/chef_base.rb', line 312

def init_command
  dirs = %w{
    cookbooks data data_bags environments roles clients
    encrypted_data_bag_secret
  }.sort.map { |dir| remote_path_join(config[:root_path], dir) }

  vars = if powershell_shell?
           init_command_vars_for_powershell(dirs)
         else
           init_command_vars_for_bourne(dirs)
         end

  prefix_command(shell_code_from_file(vars, "chef_base_init_command"))
end