This document discusses using Vagrant and Puppet to create lightweight reproducible development environments using virtual machines. It introduces Vagrant for automating VM creation and management. Puppet is used to configure VMs through scripts. The Vagrant-Binding API allows managing and configuring VMs from Java code. It provides builder APIs, JUnit integration, and access to Puppet modules. The goal is to simplify VM lifecycle management for testing and development.
2. About me
•Hendrik Ebbers
•Lead of development at SIC GmbH in
Dortmund, Germany
•Lead of JUG Dortmund
•DataFX, JFXtras Contributor
@hendrikEbbers
www.guigarage.com
hendrik.ebbers@web.de
32. Vagrant & Puppet
•define your VM with Vagrant & configure it
with Puppet
•Puppet is pre-installed on Vagrant boxes
33. Vagrant & Puppet
Vagrantfile
Vagrant::Config.run do |config|
config.vm.box = "lucid32"
config.vm.provision :puppet do |puppet|
puppet.manifests_path = "manifests"
puppet.manifest_file = "my_manifest.pp"
end
end ppet script
path to Pu
40. JUnit support
st not reachable?
@Test
public void testJdbc() { what if ho
dbHandler = new MySql(ip, db, user, pwd);
dbHandler.createMyTable();
what if table already
dbHandler.insertRow(); exists?
assertEquals(1, dbHandler.getRowCount());
dbHandler.close(); parallel proces
ses?
}
41. JUnit support
@Rule JUnit annotation manage VM lifecycle
public VagrantTestRule testRule =
new VagrantTestRule(createConfig());
public static VagrantConfiguration createConfig() {
//Configure VM with MySQL-Server & static ip
} use builder API for VM spec
ification
create VM start VM run UnitTest destroy VM