vagrant, chef and typo3 - a love affair
TRANSCRIPT
Gewinnspiel
⢠Wie viele EinhÜrner sind in den
Slides?
⢠Twitter an @codecoon und gewinne
einen USB 3.0 â Stick mit einer
Codecoon Box
Outline
⢠Motivation
⢠Introducing Vagrant & Chef
⢠TYPO3 & Vagrant
⢠âThe punkt.de Wayâ
⢠Codecoon
How can Vagrant help you?
⢠Install (multiple) TYPO3 projects in
minutes
⢠Have it âto goâ
⢠Share it with others
⢠Have a âcopyâ of your production
server
Technology StackVirtualBoxFree Open Source Virtualization Tool
ChefConfiguration ManagementFramework
VagrantâRemote Controlâ for VirtualBox
What is Vagrant?
⢠Building tool for portable work
environments
⢠Written in Ruby
⢠Open Source
⢠Build upon well-established tools
Vagrant Boxes
⢠Basically a âtweakedâ virtual
machine Image
⢠Used as base layer for all further
provisioning
⢠Many pre-installed boxes available
online:
Provisioners
⢠Run once the box is booted in
VirtualBox
⢠âWhere the magic happensâ
â Installing packages and software
â Configuration and starting of services
â E.g. creating vhost, database, ...
Providers
⢠Describe in which virtualization
environment to provision your machines
⢠Multiple providers available
â VirtualBox
â VMWare
â Amazon AWS
What is Chef?
⢠Configuration Management
Automation Tool
⢠Written in Ruby
â Provides easy-to-learn (?) DSL
⢠âInfrastructure as codeâ
â Reproducible, Testable, Versionable
Chef Components
⢠Cookbooks, Recipes, Resources
⢠Attributes
⢠Templates
⢠Roles
⢠and many moreâŚ
âââ cookbook_name âââ attributes â âââ default.rb âââ recipes â âââ default.rb âââ templates â âââ default â âââ template.erb âââ metadata.rb
Vagrant & TYPO3
⢠Find inspiration on
https://git.typo3.org/Teams/Server/Va
grant/
Typo3Org.git
Your own Vagrant Box⢠The âPlaybook-to-Cookbook-
Algorithmâ
âWrite installation steps in a text
document
â Follow steps yourself, refine document
â Give document to someone else, refine
again
â No changes in document start writing
cookbooks
Generic TYPO3 Cookbook
1. Install Packages for Apache, MySQL,
PHP
2. Provision Webspace(s) and vhost(s)
3. Provision MySQL Database(s)
4. Download TYPO3 sources (or use
Composer)
5. Clone your Git project
âThe punkt.de wayâ
⢠Project configuration in JSON files
(DataBags)
⢠Each developer works on multiple
projects
⢠Each developer has individual
projects list
âThe punkt.de wayâ
⢠Vagrant Box == Hosting Server
⢠Provisioning with Chef
⢠Chef recipes also used for Jenkins
âThe punkt.de wayâ
⢠Project files on Host
â NFS mount into Vagrant Box
â No problems with IDE & Git
â Faster provisioning after vagrant destroy
âThe punkt.de wayâ
⢠Next steps
â Provisioning of hosting servers with Chef
â Building Vagrant Boxes on CI Server
â Vagrant Boxes for customers
â Codecoon
The nice thingsâŚ
⢠Multi-Machine setup
⢠Remote Debugging with PHPStorm
⢠Local Project Files
⢠Git GUIs
⢠Ships with all the tools
â Node.js, grunt, bower, xdebug, âŚ
Biggest Pain: File Mounts
⢠3 solutions
â VirtualBox / VMWare shared folders
â Samba Mounts
â NFS Mounts
⢠Files in Box -- Mount on Host
⢠Files on Host -- Mount in Box
Codecoon
Make it fun to code again!
⢠Ready-to-use Vagrant Boxes⢠Identical to hosting environment⢠One-click deployment⢠Try it www.codecoon.com
Summary⢠Vagrant is a great tool for portable
boxes
⢠Chef can help you manage your
configuration
⢠âInfrastructure as Codeâ
⢠Same environment on dev and
production
⢠DevOps brings devs and admins
together