Using Chef::REST library , how to create a client and bootstrap with chefserver


#1

hi,

Using Chef::REST library ,i have to create a client in any provider ,register
with my chef server(bootstrap) and run any cookbook in that client it is
possible means please provide any sample code ,idea or reference

like this i need

#!/usr/bin/env ruby
require 'rubygems’
require 'chef/config’
require 'chef/log’
require 'chef/rest’
require 'chef/node’
require ‘chef/application/client’

chef_server_url="https://api.opscode.com/organizations/enablers"
client_name = “my-username"
signing_key_filename=”/root/.chef/my-username.pem"
client_name = “ganesan123"
signing_key_filename=“D:/Chef - Orchestration/chef/chefuser2/ganesan123.pem"
rest = Chef::REST.new(chef_server_url, client_name, signing_key_filename)
puts rest.get_rest(”/clients”)

Thanks and Regards,
Ganesan.A