Lightweight and reproducible environments with vagrant and Puppet
Upcoming SlideShare
Loading in...5
×
 

Lightweight and reproducible environments with vagrant and Puppet

on

  • 2,910 views

 

Statistics

Views

Total Views
2,910
Views on SlideShare
2,904
Embed Views
6

Actions

Likes
3
Downloads
60
Comments
0

2 Embeds 6

http://www.scoop.it 5
https://twitter.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Lightweight and reproducible environments with vagrant and Puppet Lightweight and reproducible environments with vagrant and Puppet Presentation Transcript

    • Lightweight and reproducible environments withVagrant & Puppet & Java
    • About me•Hendrik Ebbers•Lead of development at SIC GmbH in Dortmund, Germany•Lead of JUG Dortmund @hendrikEbbers www.guigarage.com hendrik.ebbers@web.de
    • Content•Vagrant•Puppet•Java Vagrant-Binding API
    • Vagrant
    • Vagrant Vagrant manage lifecycle•configure virtual machines by script create•create new instances on the fly•manage the VM lifecycle VM
    • Vagrant add template VM to Vagrant $ vagrant box add lucid32 http:// files.vagrantup.com/lucid32.box $ vagrant init lucid32 creates VM configuration-script $ vagrant up start the virtual machine
    • Vagrant•build on top of VirtualBox•written in Ruby by shel l & Ruby access
    • Vagrant Ubuntu 32- & 64 Lucid -bit•provides 2 template boxes by default•simple config-files it´s just Ruby Vagrant::Config.run do |config| config.vm.box = "lucid32" end see great Vagrant documentation•easy ssh connection, shared folder, etc.
    • Puppet
    • Puppet•configure your machines (nodes) by script•install and configure software & services
    • Puppet class apache { exec { apt-get update: command => /usr/bin/apt-get update } package { "apache2": ensure => present, Ap ache2 is installed } service { "apache2": & started on node ensure => running, require => Package["apache2"], } } include apache
    • Puppet•package individual components in modules•many online documentations & books out there
    • Vagrant &Puppet
    • Vagrant & Puppet•define your VM with Vagrant & configure it with Puppet•Puppet is pre-installed on Vagrant boxes
    • Vagrant & Puppet VagrantfileVagrant::Config.run do |config| config.vm.box = "lucid32" config.vm.provision :puppet do |puppet| puppet.manifests_path = "manifests" puppet.manifest_file = "my_manifest.pp" endend path to Puppet script
    • Vagrant-Binding ure & manage config VMs in Java
    • Vagrant-Binding•Java Wrapper around Vagrant•create & start VMs at runtime•only VirtualBox is required
    • Vagrant-Binding•Builder APIs•JUnit support•Puppet support
    • Builder APIVagrantVmConfig vmConfig = new VagrantVmConfigBuilder()! ! ! ! .withLucid32Box()! ! ! ! .withName("myLittleVm") builder API for VM! ! ! ! .withHostOnlyIp("192.168.50.4")! ! ! ! .build(); also builder APIVagrantEnvironment environment = ...; availableenvironment.up(); mana ge VM lifecycle! ! !environment.getVm(0).createConnection().execute("touch /tmp1");environment.destroy(); ssh connection
    • JUnit support@Test wh at if host notpublic void testJdbc() { reachable? dbHandler = new MySql(ip, db, user, pwd); dbHandler.createMyTable(); what if table already exists? dbHandler.insertRow(); assertEquals(1, dbHandler.getRowCount()); dbHandler.close(); parallel proces ses?}
    • JUnit support JUnit annotation manage VM lifecycle@Rulepublic 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
    • Vagrant-Binding fork me on github https://github.com/guigarage/vagrant-binding
    • Thanks forwatching @hendrikEbbers www.guigarage.com hendrik.ebbers@web.de