DevOps mit Vagrant und Chef

DevOps mit Vagrant und Chef

Slides zu meiner Session auf dem Barcamp Mainz 2011. Eine kurze Einführung in Server-Konfigurations-Management mit Vagrant (und Chef).

Matthias Gutjahr

December 01, 2011

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

19 slides
  1. DevOps? „DevOps is an emerging set of principles, me- thods

    and practices for collaboration between • software development and • IT operations (systems administration) professionals.“ (http://en.wikipedia.org/wiki/Devops)
  2. „DevOps is an emerging set of principles, me- thods and

    practices for collaboration between • software development and • IT operations (systems administration) professionals.“ (http://en.wikipedia.org/wiki/Devops) DevOps?
  3. Server einrichten Sich häufig wiederholende Aufgabe, daher: • Brains? •

    Shellskript? • Dokumentation im Wiki? • Proprietäre Lösung? • …
  4. Probleme • Skripte und Dokumentationen veralten • Einrichten vieler Server/Entwicklungsrechner

    • Regelmäßige Software-Aktualisierung • Neuer Mitarbeiter → neuer Rechner • Einheitliche Umgebungen
  5. Infrastructure as code • Ausführbare, testbare und versionierte Server- Dokumentation

    • Schnelles, häufiges und v.a. reproduzierbares Config-Deployment
  6. Infrastructure as code • Ausführbare, testbare und versionierte Server- Dokumentation

    • Schnelles, häufiges und v.a. reproduzierbares Config-Deployment
  7. Vagrant „Vagrant is a tool for building and distributing virtualized

    development environments.“ (http://vagrantup.com/)
  8. Standing on the shoulders of ... • VirtualBox • Ruby

    und RubyGems • Puppet oder Chef • Ab Version 4.1.x • * grummel * • Provisioning
  9. Quickstart $ gem install vagrant $ vagrant box add base

    \ http://files.vagrantup.com/lu cid32.box $ vagrant init $ vagrant up
  10. Quickstart $ gem install vagrant $ vagrant box add base

    \ http://files.vagrantup.com/lu cid32.box $ vagrant init $ vagrant up • Installiert Vagrant • Lädt vorkonfektionierte „Box“ herunter, also ein tar-File mit Image und Konfiguration • Erstellt das Vagrantfile • Fährt die Vagrant-Umgebung hoch
  11. Vagrant-Kommandos $ vagrant init $ vagrant up $ vagrant suspend

    $ vagrant resume $ vagrant ssh $ vagrant destroy • Initialisiert das aktuelle Verzeichnis • Fährt die Vagrant-Umgebung hoch • Aktuelle Umgebung unterbrechen … • … und wiederaufnehmen • SSH in die aktuelle Umgebung • Umgebung „zerstören“
  12. Chef Cookbooks enthalten die „Rezepte“, die beschreiben, wie und welche

    Software zu konfigurieren ist: chef.cookbooks_path = "cookbooks" chef.add_recipe("vagrant_main") chef.json = ({ :foo => 42, :baz => true })
  13. Vagrantfile Vagrant::Config.run do |config| config.vm.box = "lucid32" # Enable and

    configure the chef solo provisioner config.vm.provision :chef_solo do |chef| # We're going to download our cookbooks from the web chef.recipe_url = "http://files.vagrantup.com/getting_started/cookbooks.tar.gz" chef.cookbooks_path = "cookbooks" # Tell chef what recipe to run chef.add_recipe("vagrant_main") end end

More Decks by Matthias Gutjahr

Other Decks in Programming