- From: Zuhaib Siddique <
>
- To:
- Subject: [chef] Accessing Knife via Ruby
- Date: Thu, 29 Dec 2011 11:20:47 -0800
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.
Thanks
Zuhaib
- [chef] Accessing Knife via Ruby, Zuhaib Siddique, 12/29/2011
Archive powered by MHonArc 2.6.16.