class Kitchen::Provisioner::ChefAptRubyRolesChefZero

This Provisioner combines the roles of the Apt, Ruby Roles, and ChefZero provisioners, to ensure a server is ready to run before ChefZero starts its magic Must be named “Chef…” otherwise TestKitchen won't understand that we intend to use chef

Public Class Methods

new(instance, options) click to toggle source
Calls superclass method
# File lib/kitchen/provisioner/chef_apt_ruby_roles_chef_zero.rb, line 12
def initialize(instance, options)
  super
  @apt = Apt.new(instance, options)
  @chef_zero = ChefZero.new(instance, options)
  @ruby_roles = RubyRoles.new(instance, options)
end

Public Instance Methods

cleanup_sandbox() click to toggle source
# File lib/kitchen/provisioner/chef_apt_ruby_roles_chef_zero.rb, line 48
def cleanup_sandbox
  @chef_zero.cleanup_sandbox
end
create_sandbox() click to toggle source

Let chef-zero create the sandbox then convert the Ruby-based role files into JSON before uploads happen (which happen right after this returns)

# File lib/kitchen/provisioner/chef_apt_ruby_roles_chef_zero.rb, line 29
def create_sandbox
  sandbox_path = @chef_zero.create_sandbox
  @ruby_roles.roles_path = File.join(sandbox_path, "roles")
  @ruby_roles.create_sandbox
  sandbox_path
end
home_path() click to toggle source
# File lib/kitchen/provisioner/chef_apt_ruby_roles_chef_zero.rb, line 52
def home_path
  @chef_zero.home_path
end
init_command() click to toggle source
# File lib/kitchen/provisioner/chef_apt_ruby_roles_chef_zero.rb, line 23
def init_command
  @chef_zero.init_command
end
install_command() click to toggle source
# File lib/kitchen/provisioner/chef_apt_ruby_roles_chef_zero.rb, line 19
def install_command
  @chef_zero.install_command
end
prepare_command() click to toggle source
# File lib/kitchen/provisioner/chef_apt_ruby_roles_chef_zero.rb, line 36
def prepare_command
  @chef_zero.prepare_command
end
run_command() click to toggle source

Run the apt provisioner before starting up chef-zero

# File lib/kitchen/provisioner/chef_apt_ruby_roles_chef_zero.rb, line 41
def run_command
  [
    @apt.run_command,
    @chef_zero.run_command
  ].join(" && ")
end