Take a look at jclouds if you need provisioning in Java. From there, you can
either bake in the client in the AMI or shellout to run knife bootstrap.
Remember that knife bootstraps are nothing more than a shell script in an
ssh session. Take a look at any of the bootstrap templates to get a real
idea. All the client node registration is done by chef-client not knife in
However you aren’t going to be able to really reimplement chef in Java and
running the client on JRuby isn’t possible.
You might be able to use jruby and pull in the chef gems for some API
interaction if need be.
In the end, Chef is written in ruby. Whatever awkward requirements are going
to have to accept that.
If that’s a nonstarter you can also look at creating custom Whirr scripts.
On Aug 2, 2011 6:38 PM, “Daniel Cukier” email@example.com wrote:
I’m developing a web service in Java on a system that needs to provision,
create, remove nodes.
I have this restriction that the web service must be developed in Java.
This web service must:
1 - create nodes on different Cloud environments (EC2, rackspace,
2 - Bootstrap these nodes with chef and one or 2 roles
How do you suggest creating this web service? I thought about doing system
calls to knife, but I don’t think this is a good idea. Is there any Java
specific library that is similar to knife, a library that I can provision
cloud nodes (like knife ec2) and bootstrap chef (life knife bootstrap)?
Thank you very much for the help