<style> .reveal section img{ border: 0; box-shadow: none; } p.block{ width:450px; font-size:25px; text-align:left; } p span{ font-size:20px; } ul li, ol li{ font-size: 30px; } a{ font-size: 20px; } .grid-container-col2 { display: grid; grid-template-columns: auto 50px auto; padding: 0px; } .grid-item { padding-left: 10px; padding-top: 0px; font-size: 20px; text-align: left; } .grid-item , li{ font-size: 20px; padding-left:10px; } .block{ padding:0px; font-size: 22px; } .block1{ padding:0px; text-align:left; padding-left:200px; font-size: 20px; } .block1 > a{ font-size:24px; color:white; } .block2{ font-size:20px; text-align:left; padding-left:40px; } .left{ text-align:left; padding-left:40px; } .small{ padding-top:10px; font-size:28px; text-align:left; padding-left:30px; } </style> ### Einstieg in Vagrant ![](https://i.imgur.com/r6YOpAX.png =200x) --- <!-- .slide: data-background="#34495e" --> ### Agenda * Allgemeine Einordnug von Vagrant und Abgrenzung zu Terraform * Vagrant Architektur * Vagrantfile * VagrantCloud * Vagrant Basics * Wichtige Befehle * Praxis * Was ist nötig um zu starten * Ausführlicheres Beispiel mit Netzwerk (Linux VM mit mehreren Boxen) * Kleines Beispiel (Linux VM - Deploy Apache, PHP, Mysql) * Windows VM Win10 * Windows Laborumgebung aufsetzen (Win10 + WinSer2022) --- <!-- .slide: data-background="#34495e" --> <div><h3> Vagrant v.s. Terraform</h3> </div> <div class="block"> <b> Vagrant und Terraform sind beides Projekte von HashiCorp. Vagrant ist ein Tool für die Verwaltung von Entwicklungsumgebungen und Terraform ist ein Tool für den Aufbau von Infrastruktur </b></div> <div class="block"><img src="https://i.imgur.com/M01qqxC.png" width="20%"> </div> <div class="block1"> <b>Vagrant:</b><br> Entwickler: HashiCorp (Mitchell Hashimoto und John Bender) <br> Erscheinungsjahr: 08. März 2010 <br> Lizenz: MIT-Lizenz<br> URL: <a href="www.vagrantup.com">www.vagrant.com</a> </div> <p class="small"><b>Dev</b>elopment <b>Op</b>eration<b>s</b> DevOps</p> ```graphviz digraph G{ DevOps -> Development DevOps -> Operations } ``` <div class="block2"> DevOps ist eine Sammlung unterschiedlicher technischer Methoden und eine Kultur zur Zusammenarbeit zwischen Softwareentwicklung und IT-Betrieb. </div> <br> --- <!-- .slide: data-background="#34495e" --> ### VAGRANT V.S. TERRAFORM <div class="grid-container-col2"> <div class="grid-item"><img src="https://i.imgur.com/zBQsHms.png" width="60%"></div> <div class="grid-item"></div> <div class="grid-item"><img src="https://i.imgur.com/gpyJmi3.png" width="60%"></div> <div class="grid-item"> Vagrant ist eine Software die im Bereich der Softwareverteilung und Virtualisierung eingesetzt wird <br><br> <li>... Vagrant bietet eine Reihe von Funktionen auf höherer Ebene, die Terraform nicht bietet.</li><br> <li>...Funktionen wie z.B. Ordner-Sync, automatisches Networking, HTTP-Tunneling und vieles mehr sind Funktionen von Vagrant, die die Nutzung der Entwicklungsumgebung erleichtern</li><br><br><br><br> <li><b>Vagrant ist für Entwicklungsumgebungen gedacht</b></li> </div> <div class="grid-item"></div> <div class="grid-item"> Terraform ist ein quelloffenes "Infrastruktur as Code"-Tool... <br><br> <br> <li> ...kann komplexe Infrastrukturen beschreiben, die lokal oder dezentral existieren.</li><br> <li>...fokusiert sich auf die Verwaltung der Infrastruktur</li><br> <li>...wird in erster Linie für die Verwaltung von Ressourcen bei Cloud-Anbietern wie AWS, Azure aber auch OpenStack verwendet.</li> <br> <br> <li><b>Terraform ist für das allgemeine Infrastrukturmanagement gedacht</b> </li> </div> </div> --- <!-- .slide: data-background="#34495e" --> ## Vagrant Architektur ![](https://i.imgur.com/NGWcpbb.png =900x) --- ### Beispiel Infrastruktur hochfahren ``` stephan:$ vagrant up ``` ![](https://i.imgur.com/KOCJLRc.png =750x) --- <!-- .slide: data-background="#34495e" --> ### Vagrant Basics und Begriffe <br> * Projektinitialisierung ( vagrant init ) * Boxen (Box ≙ ISO-Image) * Vagrant Cloud -> Hoster für Boxen * Konfiguration -> vagrantfile * Provisioning -> * Vagrant ruft andere Programme auf, die das Ziel-System "konfigurieren". Beispiele: Shell-Scripte, Ansible, Chef - (SCM -> Software Configuration Management) <br> --- <!-- .slide: data-background="#34495e" --> ### Einige Vagrant Commands <br> ```bash! vagrant init # initilaize vagrant template file vagrant up # execute the vagrant file vagrant halt # to shut down the VM(s) vagrant suspend # to suspend the VM(s), vagrant status # to display the status of the VM(s) vagrant destroy # to destroy (delete) the VM(s) vagrant up --provision # Starting the VM vagrant reload --provision # Restarting the VM ``` --- <!-- .slide: data-background="#34495e" --> ### - Praxis - <p class="left" ><u>Was ist nötig um zu starten:</u></p> <ul class="list"> <li>Installation einer Virtualisierungssoftware - VirtualBox, VMWare, HyperV</li> <ul class="sublist"> <li> virtualbox-guest-additions-guest.install</li> <li> VirtualBox Extension Pack</li> </ul> <li>Installation Vagrant - Verfügbar für Windows, MAC, Linux</li> </ul> <br><br> ``` vagrant init ``` --- <!-- .slide: data-background="#34495e" --> ### I Löschen der Laborumgebung ![](https://i.imgur.com/KOCJLRc.png =750x) ``` vagrant destroy ``` --- <!-- .slide: data-background="#34495e" --> ### II Beispiel Setup Basis Box <br> <p class="small">Linux Ubuntu20.04 VM aufsetzen</p><br> ``` Vagrant.configure("2") do |config| config.vm.box = "ubuntu/focal64" end ``` --- <!-- .slide: data-background="#34495e" --> ### III Beispiel <h5>Setup einer einfachen Entwicklungsumgebung</h5> * Linux Ubuntu20.04 VM * Provisionierung - * Apache * PHP * MySQL * Update index.html --- <!-- .slide: data-background="#34495e" --> ### IV Windows Infrastruktur * Client Windows 10 * Deploy eine Software mit chocolatey * Server Windows 2019 --- ## Q & A --- ### Quellen [DevOpsCube - Beginner Tutorial Vagrant](https://devopscube.com/vagrant-tutorial-beginners/) [Scottlowe Into Vagrant](https://blog.scottlowe.org/2014/09/12/a-quick-introduction-to-vagrant/) [IBM Terraform](https://www.ibm.com/de-de/cloud/learn/terraform) [Vagrant vs Terraform](https://www.vagrantup.com/intro/vs/terraform) [Vagrant Cloud Vagrant Boxes](https://app.vagrantup.com/boxes/search) ---- ---- --- ---- ### Source ![Terraform](https://i.imgur.com/JmRh42q.png) ![Vagrant](https://i.imgur.com/S8GvcTW.png) ![](https://i.imgur.com/F21FcHa.png) ![Terraform_logo](https://i.imgur.com/gpyJmi3.png) ![Vagrant_logo](https://i.imgur.com/zBQsHms.png) ![](https://i.imgur.com/M01qqxC.png =350x) ---- Powershell Script Write-Host “Hello World!“ Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) choco install notepadplusplus -y Start-Process -FilePath "C:\Users\vagrant\Downloads\CiscoPacketTracer_820_Windows_64bit.exe" -Verb runAs -ArgumentList '/s','/v"/qn"' ---
{"metaMigratedAt":"2023-06-16T19:49:46.116Z","metaMigratedFrom":"YAML","title":"Vagrant","breaks":true,"slideOptions":"{\"theme\":\"white\"}","contributors":"[{\"id\":\"cc88b83f-0892-4f6e-a347-ba908830fcc5\",\"add\":22812,\"del\":15125}]"}
    443 views