- From: Seth Chisamore <
>
- To:
- Subject: [chef] Re: Re: Calling Chef::Knife::Ssh directly(?)
- Date: Wed, 1 Jun 2011 13:54:40 -0400
It appears you have a conflict between the node_name associated with your
client_key and the one you are setting with:
knife_ssh.config[:node_name]
The client key is most likely being picked up in the config file passed in
with:
knife_ssh.config[:config_file]
You should make a choice to either set all values in the config file...or
punt and set all values manually (ie node_name, client_key, chef_server_url
etc.) in the knfe_ssh.config hash.
Seth
--
Opscode, Inc.
Seth Chisamore, Senior Technical Evangelist
IRC, Skype, Twitter, Github: schisamo
On Wednesday, June 1, 2011 at 1:42 PM, Noah Kantrowitz wrote:
>
You might want to look in to Fabric+PyChef for this, it is actually
>
made for the task :-)
>
>
--Noah
>
>
On Jun 1, 2011, at 10:29 AM, Miles, Ken wrote:
>
>
> Folks,
>
>
>
> I am investigating switching some of our Ruby scripts from using the
>
> 'system' function to calling the Chef libraries directly and am not
>
> having much success. My latest error is:
>
>
>
> /usr/lib/ruby/gems/1.8/gems/chef-0.9.8/lib/chef/rest/
>
> auth_credentials.rb:41:
>
> in `signature_headers': Cannot sign the request without a client name,
>
> check that :node_name is assigned (ArgumentError)
>
>
>
> Below is a code snippet.
>
>
>
> query = "role:#{role}"
>
> knife_ssh = Chef::Knife::Ssh.new()
>
> knife_ssh.config[:config_file] = conf_file
>
> knife_ssh.config[:identity_file] = params["private_key"]
>
> knife_ssh.config[:node_name] = ENV['HOSTNAME']
>
> knife_ssh.config[:client_name] = ENV['HOSTNAME']
>
> cmd_line = "hostname -f"
>
> knife_ssh.name_args = [query, cmd_line]
>
> sys_status = knife_ssh.run
>
>
>
> What am I doing wrong here?
>
>
>
> Thanks,
>
>
>
> Ken Miles
>
>
>
>
>
> (mailto:
)
Archive powered by MHonArc 2.6.16.