Skip to content

Instantly share code, notes, and snippets.

@Atalanta
Created May 14, 2013 02:53
Show Gist options
  • Save Atalanta/5573306 to your computer and use it in GitHub Desktop.
Save Atalanta/5573306 to your computer and use it in GitHub Desktop.
Given a machine with the following specification has been provisioned:
| OS | Linux |
| Version | Centos 6.4 |
| Arch | 64 bit |
| Chef Version | 11.4.4 |
| Run List | recipe[chruby::system] |
@fnichol
Copy link

fnichol commented May 14, 2013

require 'kitchen'

class Leibniz::KitchenLoader
  def initialize(hash)
    @hash = hash
  end

  # return Hash
  def read
   @hash.make_kitcheny
  end
end

leibiz_loader = Leibniz::KitchenLoader.new()

@config = Kitchen::Config.new(:loader => leibniz_loader)

# one machine
instances = @config.instances
instances.first.converge

# a bunch
actors = @config.instance_actors
futures = actors.map { |actor| actor.future.converge }

futures.map { |f| f.value }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment