Access Puppet Forge Repository with Java
#Vagrant-Binding
To integrate Puppet modules more easy to Vagrant-Binding projects I created a Java API that access Puppet Forge by REST. You can search for modules or download any module to your locale disc. So you can easily add modules from the repository to your own Vagrant environments. The API is currently not part of Vagrant-Binding and can be found here but I plan to integrate the API in the future. Additionally I added a demo to the [Vagrant-Binding-Demos]({{ site.baseurl }}{% post_url 2012-11-03-vagrant-binding-demos %} ) project that can be found at github. Here is a short example that uses the API:
PuppetForgeClient client = new PuppetForgeClient();
File moduleFolder = new File("/path/to/my/modules");
ListallDescriptions = client.findModules("mongodb");
for(PuppetForgeModuleDescription description : allDescriptions) {
System.out.println("Installing " + description.getFullName());
PuppetForgeModule module = client.findModule(description);
client.installToModulesDir(moduleFolder, module);
}
Hendrik Ebbers
Hendrik Ebbers is the founder of Open Elements. He is a Java champion, a member of JSR expert groups and a JavaOne rockstar. Hendrik is a member of the Eclipse JakartaEE working group (WG) and the Eclipse Adoptium WG. In addition, Hendrik Ebbers is a member of the Board of Directors of the Eclipse Foundation.