[chef-dev] How to parse knife.rb


Chronological Thread 
  • From: Cassiano Leal < >
  • To: Chef Dev < >
  • Subject: [chef-dev] How to parse knife.rb
  • Date: Thu, 21 Mar 2013 23:10:54 -0300

Hi,

Sorry if this is not the best forum for my question, but it seems to be more appropriate than the regular Chef's user list.

I'm the author of vagrant-butcher [0], a Vagrant plugin that deletes node and client when the VM is destroyed.

The way the plugin works is by reading knife's configuration and then using Chef::REST to do the deletions.

This has to change now, though. It's not possible to install the plugin on the latest version of Vagrant because it requires a version of net-ssh that conflicts with Chef's. [1]

What I'm trying to do now is to parse knife.rb so that I can feed Ridley [2] the constructor parameters it needs to create a connection to Chef's API, but this is proving to be quite a challenge.

Has anyone done it before? Does anyone have any pointers to the best way of doing that?

I've been experimenting with evaluating the code in knife.rb, but it's (1) an ugly hack, and (2) not working :)

Thanks!
- cassiano

[0] https://github.com/cassianoleal/vagrant-butcher
[1] https://github.com/cassianoleal/vagrant-butcher/issues/5
[2] https://github.com/reset/ridley




Archive powered by MHonArc 2.6.16.

§