Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.
Lightweight and reproducible environments                  withVagrant & Puppet                   & Java
About me•Hendrik Ebbers•Lead of development at SIC GmbH in Dortmund, Germany•Lead of JUG Dortmund                         ...
Content•Vagrant•Puppet•Java Vagrant-Binding API
Vagrant
Vagrant                                         Vagrant                                                     manage lifecyc...
Vagrant                                add template VM to Vagrant $ vagrant box add lucid32 http:// files.vagrantup.com/lu...
Vagrant•build on top of VirtualBox•written in Ruby                          by shel l & Ruby                   access
Vagrant                                  Ubuntu                                         32- & 64                          ...
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":     ensur...
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 = "lucid...
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")...
JUnit support@Test                            wh at if host notpublic void testJdbc() {         reachable?    dbHandler = ...
JUnit support             JUnit annotation             manage VM lifecycle@Rulepublic VagrantTestRule testRule =       new...
Vagrant-Binding                             fork me                                     on github  https://github.com/guig...
Thanks   forwatching         @hendrikEbbers       www.guigarage.com   hendrik.ebbers@web.de
Nächste SlideShare
Wird geladen in …5
×

Lightweight and reproducible environments with vagrant and Puppet

3.612 Aufrufe

Veröffentlicht am

  • Als Erste(r) kommentieren

Lightweight and reproducible environments with vagrant and Puppet

  1. 1. Lightweight and reproducible environments withVagrant & Puppet & Java
  2. 2. 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
  3. 3. Content•Vagrant•Puppet•Java Vagrant-Binding API
  4. 4. Vagrant
  5. 5. Vagrant Vagrant manage lifecycle•configure virtual machines by script create•create new instances on the fly•manage the VM lifecycle VM
  6. 6. 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
  7. 7. Vagrant•build on top of VirtualBox•written in Ruby by shel l & Ruby access
  8. 8. 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.
  9. 9. Puppet
  10. 10. Puppet•configure your machines (nodes) by script•install and configure software & services
  11. 11. 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
  12. 12. Puppet•package individual components in modules•many online documentations & books out there
  13. 13. Vagrant &Puppet
  14. 14. Vagrant & Puppet•define your VM with Vagrant & configure it with Puppet•Puppet is pre-installed on Vagrant boxes
  15. 15. 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
  16. 16. Vagrant-Binding ure & manage config VMs in Java
  17. 17. Vagrant-Binding•Java Wrapper around Vagrant•create & start VMs at runtime•only VirtualBox is required
  18. 18. Vagrant-Binding•Builder APIs•JUnit support•Puppet support
  19. 19. 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
  20. 20. 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?}
  21. 21. 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
  22. 22. Vagrant-Binding fork me on github https://github.com/guigarage/vagrant-binding
  23. 23. Thanks forwatching @hendrikEbbers www.guigarage.com hendrik.ebbers@web.de

×