Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Create a bunch of nodes & clients with chef-api and fauxhai
#!/usr/bin/env ruby
require 'chef-api'
require 'fauxhai'
include ChefAPI::Resource
ChefAPI.configure do |config|
config.endpoint = 'http://nineveh.local:4545'
config.client = 'admin'
config.key = '~/etc/goiardi/admin.pem'
(0..1000).each do |x|
auto = Fauxhai.mock(platform:'debian', version:'7.2') do |node|
node['hostname'] = "server#{x}"
n = = "server#{x}"
n.automatic =
Client.create(:name =>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment