Entwicklungsteams stehen heutzutage unter enormen Zeitdruck, da gilt: "In the new world, it is not the big fish which eats the small fish, it’s the fast fish which eats the slow fish" (Klaus Schwab, Founder and Executive Chairman of the World Economic Forum). Weiterhin muss Software gegen Testsysteme entwickelt und getestet werden, die soweit wie möglich an Produktionssysteme angelehnt sind, um Aussagen wie "Runs on my machine" endgültig abzuwürgen. Aufgrund des Zeitdrucks müssen diese Testsysteme sehr schnell aufgesetzt und auch wieder zerstört werden können. Vagrant versucht diese Probleme zu lösen, indem es vorhandene Virtualisierungs- und Provisionierungs-Tools orchestriert und damit Entwicklern die Möglichkeit bietet Testsysteme lokal und in "self-service" zu verwalten. Dieser TechTalk soll Entwicklern eine Einführung in die Konzepte und Benutzung von Vagrant geben.
2. “Vagrant is a tool for building complete development
environments. [...] Vagrant lowers development
environment setup time [...] and makes the "works
on my machine" excuse a relic of the past.”
Was ist Vagrant?
Quelle: https://www.vagrantup.com/about.html
3. Orchestrations-Tool für VMs
Provider: VirtualBox, VMware, AWS, libvirt, Docker …
Provisioner: Shell Scripts, Puppet, Ansible, Docker …
Ruby
Plugins
Was ist Vagrant?
4. 2010 von Mitchell Hashimoto
Gründung von HashiCorp 2012
Open Source, MIT License
Linux, Mac OS X, Windows
Was ist Vagrant?
17. Puppet-Run starten ohne Master
Vagrant.configure(2) do |config|
...
config.vm.provision :puppet do |puppet|
puppet.manifests_path = 'puppet/manifests'
puppet.module_path = 'puppet/modules'
puppet.options = '--test'
end
...
end
Vagrantfile - Puppet Provisioner (apply)
18. Management Interface + NAT
Port Forwarding, Private Network, Bridge
DHCP oder Static IP
MAC-Adressen
Mehrere Netzwerke möglich
Vagrantfile - Network
19. Port Forwarding
Vagrant.configure(2) do |config|
...
config.vm.network :forwarded_port,
:guest => 5432, :host => 5432
config.vm.network :forwarded_port,
:guest => 8080, :host => 8080
...
end
Vagrantfile - Network