- From: Noah Kantrowitz <
>
- To:
- Subject: [chef] Re: Accessing Knife via Ruby
- Date: Thu, 29 Dec 2011 12:48:10 -0800
On Dec 29, 2011, at 11:20 AM, Zuhaib Siddique wrote:
>
Hey,
>
>
So I am writing a ruby script that will help with our deployments and as
>
part of that I am leveraging the Chef REST API which is great but with some
>
of that information I want to be able to pass that over to knife to do
>
deletes. An example code is the following:
>
>
require 'chef/knife/ec2_server_delete'
>
delete_ec2 = Chef::Knife::Ec2ServerDelete.new()
>
delete_ec2.name_args = node.ec2.instance_id
>
delete_ec2.run
>
>
This works but I get the following error:
>
>
ERROR: You did not provided a valid 'AWS Access Key Id' value.
>
ERROR: You did not provided a valid 'AWS Secret Access Key' value.
>
>
But both are set and work correctly from the command line. Also If I do
>
this using the knife exec command it works. I assume I am missing
>
something in my ruby but I am just pulling a blank and can't seem to find
>
any hints from looking at the chef/knife source code. Any pointers would
>
be great.
There isn't really any reason to try and use Knife like this, just use Fog
directly for a much better API.
--Noah
Attachment:
signature.asc
Description: Message signed with OpenPGP using GPGMail
Archive powered by MHonArc 2.6.16.