- From: Daniel DeLeo <
>
- To:
- Subject: [chef] Re: How to use setuped credentials and parameters in ruby script to access with Chef::REST ?
- Date: Thu, 28 Aug 2014 07:45:44 -0700
On Tuesday, August 26, 2014 at 3:44 AM, Vladimir Skubriev wrote:
>
Knife can operate with chef server normally, by using knife.rb and saved
>
admin.pem in user home.
>
>
I have script on chef admin's machine and I want that this script can
>
operate with chef server with same configs as knife operate with it. I.e.
>
without additional configuration as follows:
>
>
# Define chef server parameters
>
chef_server_url="https://chef.example.com"
>
client_name = "adminws.example.local"
>
signing_key_filename="/etc/chef/client.pem"
>
>
...
>
>
>
That's part of this script, where i need this variables:
>
...
>
# Operate with chef server:
>
rest = Chef::REST.new(chef_server_url, client_name, signing_key_filename)
>
#puts rest.get_rest("/data/#{bag}/#{item}")
>
rest.get_rest("/data/#{bag}/#{item}")
>
>
>
...
>
>
How i can make my script "universe"?
>
>
--
>
Faithfully yours,
>
>
CVision Lab System Administrator
>
Vladimir Skubriev
Sorry for the late reply here. Probably your easiest option is to write your
own knife plugin:
http://docs.getchef.com/plugin_knife_custom.html
--
Daniel DeLeo
Archive powered by MHonArc 2.6.16.