SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Downloaden Sie, um offline zu lesen
Keep calm and
vagrant up
(ok, clear the cache)
DrupalSH Meetup
June, 19th 2013
Shanghai, China
Daniel Lopes
http://dgo.to/@dscl
WAIT!
vagrant
what ???
NOT SO FAST...
1. Who am I?
2. What is vagrant?
3. Motivations
4. Common vs. Virtualized environments
5. Boxes
6. Provisioning
7. Other points (hands-on)
8. Useful links
First, our agenda…
Daniel Lopes
Brazilian Software Architect living in
China since dez/2011
Working with PHP since 1999 (php3)
and with Drupal since 2009 (Drupal 6)
Drupal Translator and Reviewer for
the Brazilian Portuguese team since
2010
http://dgo.to/@dscl
http://www.linkedin.com/in/danielscl
http://www.facebook.com/danielscl
Who am I?
What is vagrant?
Vagrant is a tool for building complete development environments.
With an easy-to-use workflow and focus on automation, Vagrant
lowers development environment setup time, increases
development/production parity, and makes the "works on my
machine" excuse a relic of the past.
Create and configure lightweight,
reproducible, and portable
development environments.
- vagrantup.com
Motivations…
Setting up a fully configured environment for the Drupal Global
Training Day attendees to work on as fast as possible and as
effortless as possible
Anyone, technical or non-technical people, should be able to set it up
by following a step-by-step tutorial
The solution should be small and lightweight
But it should remain useful after the training
Real motivations…
I heard a lot about Vagrant for development and even for production
server, and I was looking for an opportunity to use it!
Common ones:
● Upper-case vs. Lower-case
● Windows line break vs. Unix-like line break
● / vs. /my-project
● Different versions of the software (L|W|M)AMP
I am tired of having infrastructure related issues within my teams and
projects.
I want to have an homogenous configuration among my development
team.
The initial environment setup for new developers takes too long to be
done.
Common Dev environment
Drupal itself runs over a web server
(usually, Apache) with PHP on it and a
database (usually, MySQL). And all of them
can be running on Linux, Windows or
MacOS.
There are a few installer to help you to configure this in your computer
like:
For Windows: WAMP - http://www.wampserver.com/en/
For MacOS: MAMP - http://www.mamp.info/en/index.html
For Linux? Come on, you have it already by default...
Virtualized Dev environment
The developer needs to simply load a VM (Virtual Machine) based on
Ubuntu using Vagrant and Virtualbox so you have everything running
very fast and almost effortless.
Required downloads:
Virtualbox 4.2+: https://www.virtualbox.org/wiki/Downloads
Vagrant 1.2.2: http://downloads.vagrantup.com/tags/v1.2.2
Ubuntu 12.04 box: http://files.vagrantup.com/precise32.box
Boxes
Boxes are the skeleton from which Vagrant machines are constructed.
They are portable files which can be used by others on any platform
that runs Vagrant to bring up a working environment.
Boxes are provider-specific.
Providers are the virtualization tools which are supported by vagrant.
So you must obtain the proper box depending on what provider you're
using, like:
- Virtualbox, which is out-of-the-box in the open-source version;
- VMWare. vagrant paid version (http://www.vagrantup.com/vmware);
- and even AWS (https://github.com/mitchellh/vagrant-aws).
$ vagrant box add base http://files.vagrantup.com/precise32.box
$ vagrant init
$ vagrant up
This is the name of
your box.
Always use 'base'
for your first one.
Vagrantfile
The only configuration file needed by vagrant to work.
It defines the box that the VM will run, as well as several other
configuration like:
● config.vm.box_url:
URL from where the box can be downloaded.
● config.vm.guest:
defines the OS that the VM is running.
● config.vm.network:
general network configuration. (details later)
● config.vm.provider:
the provider software or platform for this VM.
● config.vm.provision:
how is the VM going to be provisioned.
● config.vm.synced_folder:
folder to be shared between the host and the VM.
Provisioning
Provisioning is the action that allows you to install/remove/update
software and add or alter any kind of configuration into the VM system
while getting it up.
Vagrant uses 6 different ways of provisioning, which are:
● Shell script
● Ansible (YAML)
● Chef Solo
● Chef Client
● Puppet apply (serverless)
● Puppet agent
But I will show only 2 of them:
● Shell script
● Puppet apply (serverless)
Provisioning with Shell Script
This is pretty straight-forward shell scripting.
You can use it in-line and also create an external file that will be pushed
to the VM during the process of getting this up.
Heads-up!
Keep in mind that every time you hit vagrant up or vagrant reload,
this script will be executed. So care about the execution flow of the
script commands (if-else, loops, etc)
Provisioning with Puppet
Puppet is a complete server provisioner that allows you to deeply
manage any configuration within your server. You can even control
deployments using it.
With Vagrant it is used to have a better way to manage the VM
configuration and installed software.
Puppet have a lot of modules that can be used to add new features to
it. Find more about it at: https://forge.puppetlabs.com/
Network
Vagrant allows you to map ports used by services from inside the VM
to port numbers in the host machine.
By default, it suggests you to use port number over 2200.
It also allows you to use private network, which can use IPs that are
only accessible from the host machine.
In case you use a private network IP, we'll be able to use ANY port
number in the forwarded_port option.
Synced folders
Vagrant allows you to easily map folders from the host machine
(physical) to the guest VM.
Great way to keep using your current local projects` files instead of
pushing everything to inside the VM.
In the following example you can see a way to replace Apache's
default docroot ( /var/www ) with your local directory for projects (..
/projects ).
Synced folders
HEADS UP!
● Note that the local directory is being referenced through a relative
path. For this you should consider the directory where the
Vagrantfile is as the current directory, then navigate any way you
like;
● When dealing with Windows host machines, keep the
Vagrantfile and the folder you want to sync in the same partition
(e.g.: C: or D:).
Packing and Distributing
Packing means creating new box files from a machine that is currently
present in your system.
You can easily pack new boxes from a your current machine using:
$ vagrant package [vm-name] –output desired-name.box
There are other option for this command to allow you, for instance,
pack a Vagrantfile as part of your new box file.
Packing and Distributing
Distributing means making the box file that you've just created
available to your team or to anyone over the Internet.
You can push it to github, Dropbox or any other place of your taste,
and then send a Pull request to Vagrantbox.es so you can get this
added to their list.
More about boxes...
If you want to, you can even create a new ones from scratch with
Veewee (https://github.com/jedi4ever/veewee)
From scratch means getting your favorite OS, favorite apps and so on,
and put it together.
How to use Veewee?
Read!
http://github.com/jedi4ever/veewee/blob/master/doc/vagrant.md
Watch!
http://www.youtube.com/watch?v=3vaLTVkKCPI
Useful links
Vagrant docs: http://docs.vagrantup.com/v2/
Vagrant boxes: http://vagrantbox.es
Veewee: https://github.com/jedi4ever/veewee
Aegir-up: https://drupal.org/project/aegir-up
Puppet docs: http://docs.puppetlabs.com/
Puppet modules: https://forge.puppetlabs.com/
THANKS A
LOT FOR
YOUR TIME

Weitere ähnliche Inhalte

Was ist angesagt?

Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient waySylvain Rayé
 
Vagrant-Overview
Vagrant-OverviewVagrant-Overview
Vagrant-OverviewCrifkin
 
Vagrant for Virtualized Development
Vagrant for Virtualized DevelopmentVagrant for Virtualized Development
Vagrant for Virtualized DevelopmentAdam Culp
 
Docker for developers
Docker for developersDocker for developers
Docker for developerssparkfabrik
 
Docker workshop
Docker workshopDocker workshop
Docker workshopEvans Ye
 
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...Artefactual Systems - AtoM
 
Docker Container - Mesaque Silva
Docker Container - Mesaque SilvaDocker Container - Mesaque Silva
Docker Container - Mesaque Silvadeveloperstigv
 
[drupalday2017] - Devel - D8 release party
[drupalday2017] - Devel - D8 release party[drupalday2017] - Devel - D8 release party
[drupalday2017] - Devel - D8 release partyDrupalDay
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker皓鈞 張
 
Minicurso de Vagrant
Minicurso de VagrantMinicurso de Vagrant
Minicurso de VagrantLeandro Nunes
 
Devel for Drupal 8
Devel for Drupal 8Devel for Drupal 8
Devel for Drupal 8Luca Lusso
 
OpenNebulaConf 2016 - LAB ONE - Vagrant running on OpenNebula? by Florian Heigl
OpenNebulaConf 2016 - LAB ONE - Vagrant running on OpenNebula? by Florian HeiglOpenNebulaConf 2016 - LAB ONE - Vagrant running on OpenNebula? by Florian Heigl
OpenNebulaConf 2016 - LAB ONE - Vagrant running on OpenNebula? by Florian HeiglOpenNebula Project
 
The future of the php development environment
The future of the php development environmentThe future of the php development environment
The future of the php development environmentJeremy Quinton
 
Vagrant are you still develop in a non-virtual environment-
Vagrant  are you still develop in a non-virtual environment-Vagrant  are you still develop in a non-virtual environment-
Vagrant are you still develop in a non-virtual environment-Anatoly Bubenkov
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composernuppla
 
Drupal Developer Days Keynote
Drupal Developer Days KeynoteDrupal Developer Days Keynote
Drupal Developer Days KeynoteAngela Byron
 
Apache Flink Crash Course by Slim Baltagi and Srini Palthepu
Apache Flink Crash Course by Slim Baltagi and Srini PalthepuApache Flink Crash Course by Slim Baltagi and Srini Palthepu
Apache Flink Crash Course by Slim Baltagi and Srini PalthepuSlim Baltagi
 

Was ist angesagt? (20)

Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient way
 
Vagrant-Overview
Vagrant-OverviewVagrant-Overview
Vagrant-Overview
 
Vagrant for Virtualized Development
Vagrant for Virtualized DevelopmentVagrant for Virtualized Development
Vagrant for Virtualized Development
 
Docker for developers
Docker for developersDocker for developers
Docker for developers
 
Using vagrant
Using vagrantUsing vagrant
Using vagrant
 
Docker workshop
Docker workshopDocker workshop
Docker workshop
 
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
AtoM and Vagrant: Installing and Configuring the AtoM Vagrant Box for Local T...
 
Docker Container - Mesaque Silva
Docker Container - Mesaque SilvaDocker Container - Mesaque Silva
Docker Container - Mesaque Silva
 
[drupalday2017] - Devel - D8 release party
[drupalday2017] - Devel - D8 release party[drupalday2017] - Devel - D8 release party
[drupalday2017] - Devel - D8 release party
 
Drupal refcard
Drupal refcardDrupal refcard
Drupal refcard
 
Intro to vagrant
Intro to vagrantIntro to vagrant
Intro to vagrant
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Minicurso de Vagrant
Minicurso de VagrantMinicurso de Vagrant
Minicurso de Vagrant
 
Devel for Drupal 8
Devel for Drupal 8Devel for Drupal 8
Devel for Drupal 8
 
OpenNebulaConf 2016 - LAB ONE - Vagrant running on OpenNebula? by Florian Heigl
OpenNebulaConf 2016 - LAB ONE - Vagrant running on OpenNebula? by Florian HeiglOpenNebulaConf 2016 - LAB ONE - Vagrant running on OpenNebula? by Florian Heigl
OpenNebulaConf 2016 - LAB ONE - Vagrant running on OpenNebula? by Florian Heigl
 
The future of the php development environment
The future of the php development environmentThe future of the php development environment
The future of the php development environment
 
Vagrant are you still develop in a non-virtual environment-
Vagrant  are you still develop in a non-virtual environment-Vagrant  are you still develop in a non-virtual environment-
Vagrant are you still develop in a non-virtual environment-
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composer
 
Drupal Developer Days Keynote
Drupal Developer Days KeynoteDrupal Developer Days Keynote
Drupal Developer Days Keynote
 
Apache Flink Crash Course by Slim Baltagi and Srini Palthepu
Apache Flink Crash Course by Slim Baltagi and Srini PalthepuApache Flink Crash Course by Slim Baltagi and Srini Palthepu
Apache Flink Crash Course by Slim Baltagi and Srini Palthepu
 

Andere mochten auch

Getting Started with Drupal VM
Getting Started with Drupal VMGetting Started with Drupal VM
Getting Started with Drupal VMOPIN Software Inc.
 
Modernize Your Drupal Development
Modernize Your Drupal DevelopmentModernize Your Drupal Development
Modernize Your Drupal DevelopmentChris Tankersley
 
A Manifesto Of Reading The Bible As Scripture
A Manifesto Of Reading The Bible As ScriptureA Manifesto Of Reading The Bible As Scripture
A Manifesto Of Reading The Bible As Scriptureguest4b2021
 
McCann Sydney PowerPoint Karaoke 2
McCann Sydney PowerPoint Karaoke 2McCann Sydney PowerPoint Karaoke 2
McCann Sydney PowerPoint Karaoke 2Frank Lang
 
Krishna And The Demigods
Krishna And The DemigodsKrishna And The Demigods
Krishna And The DemigodsYahshua Hosch
 
Narada Muni Instructs Vyasadeva
Narada Muni Instructs VyasadevaNarada Muni Instructs Vyasadeva
Narada Muni Instructs VyasadevaYahshua Hosch
 
Concept voor Habitat for Humanity, 8UO, 26 maart 2010, Amsterdam
Concept voor Habitat for Humanity, 8UO, 26 maart 2010, AmsterdamConcept voor Habitat for Humanity, 8UO, 26 maart 2010, Amsterdam
Concept voor Habitat for Humanity, 8UO, 26 maart 2010, AmsterdamInge Kuijper
 
International Piracy Pan Am Days 2008
International Piracy  Pan Am Days 2008International Piracy  Pan Am Days 2008
International Piracy Pan Am Days 2008Jose Barragan Codina
 
Material Problems And Spiritual Solutions
Material Problems And Spiritual SolutionsMaterial Problems And Spiritual Solutions
Material Problems And Spiritual SolutionsYahshua Hosch
 
McCann Sydney Powerpoint Karaoke 1
McCann Sydney Powerpoint Karaoke 1McCann Sydney Powerpoint Karaoke 1
McCann Sydney Powerpoint Karaoke 1Frank Lang
 
Week 11 (Pengenalan Html 1) Student
Week 11 (Pengenalan Html 1)   StudentWeek 11 (Pengenalan Html 1)   Student
Week 11 (Pengenalan Html 1) Studentimaru.wordpress.com
 
First Instruction In Bhagavatam
First Instruction In BhagavatamFirst Instruction In Bhagavatam
First Instruction In BhagavatamYahshua Hosch
 
McCann Sydney PowerPoint Karaoke 3
McCann Sydney PowerPoint Karaoke 3McCann Sydney PowerPoint Karaoke 3
McCann Sydney PowerPoint Karaoke 3Frank Lang
 
Material Problems And Spiritual Solutions
Material Problems And Spiritual SolutionsMaterial Problems And Spiritual Solutions
Material Problems And Spiritual SolutionsYahshua Hosch
 
Upadesamrita (Text 1)
Upadesamrita (Text 1)Upadesamrita (Text 1)
Upadesamrita (Text 1)Yahshua Hosch
 
Krishna And The Demigods2
Krishna And The Demigods2Krishna And The Demigods2
Krishna And The Demigods2Yahshua Hosch
 
Drupaldelphia 2014 - Standardize Environments with Vagrant
Drupaldelphia 2014 - Standardize Environments with VagrantDrupaldelphia 2014 - Standardize Environments with Vagrant
Drupaldelphia 2014 - Standardize Environments with Vagrantkarschsp
 

Andere mochten auch (20)

Getting Started with Drupal VM
Getting Started with Drupal VMGetting Started with Drupal VM
Getting Started with Drupal VM
 
KEEP CALM AND SPEAK THE TRUTH
KEEP CALM AND SPEAK THE TRUTHKEEP CALM AND SPEAK THE TRUTH
KEEP CALM AND SPEAK THE TRUTH
 
Modernize Your Drupal Development
Modernize Your Drupal DevelopmentModernize Your Drupal Development
Modernize Your Drupal Development
 
A Manifesto Of Reading The Bible As Scripture
A Manifesto Of Reading The Bible As ScriptureA Manifesto Of Reading The Bible As Scripture
A Manifesto Of Reading The Bible As Scripture
 
Ch 3 Bhagavatam
Ch 3 BhagavatamCh 3 Bhagavatam
Ch 3 Bhagavatam
 
McCann Sydney PowerPoint Karaoke 2
McCann Sydney PowerPoint Karaoke 2McCann Sydney PowerPoint Karaoke 2
McCann Sydney PowerPoint Karaoke 2
 
Ch 3 Bhagavatam
Ch 3 BhagavatamCh 3 Bhagavatam
Ch 3 Bhagavatam
 
Krishna And The Demigods
Krishna And The DemigodsKrishna And The Demigods
Krishna And The Demigods
 
Narada Muni Instructs Vyasadeva
Narada Muni Instructs VyasadevaNarada Muni Instructs Vyasadeva
Narada Muni Instructs Vyasadeva
 
Concept voor Habitat for Humanity, 8UO, 26 maart 2010, Amsterdam
Concept voor Habitat for Humanity, 8UO, 26 maart 2010, AmsterdamConcept voor Habitat for Humanity, 8UO, 26 maart 2010, Amsterdam
Concept voor Habitat for Humanity, 8UO, 26 maart 2010, Amsterdam
 
International Piracy Pan Am Days 2008
International Piracy  Pan Am Days 2008International Piracy  Pan Am Days 2008
International Piracy Pan Am Days 2008
 
Material Problems And Spiritual Solutions
Material Problems And Spiritual SolutionsMaterial Problems And Spiritual Solutions
Material Problems And Spiritual Solutions
 
McCann Sydney Powerpoint Karaoke 1
McCann Sydney Powerpoint Karaoke 1McCann Sydney Powerpoint Karaoke 1
McCann Sydney Powerpoint Karaoke 1
 
Week 11 (Pengenalan Html 1) Student
Week 11 (Pengenalan Html 1)   StudentWeek 11 (Pengenalan Html 1)   Student
Week 11 (Pengenalan Html 1) Student
 
First Instruction In Bhagavatam
First Instruction In BhagavatamFirst Instruction In Bhagavatam
First Instruction In Bhagavatam
 
McCann Sydney PowerPoint Karaoke 3
McCann Sydney PowerPoint Karaoke 3McCann Sydney PowerPoint Karaoke 3
McCann Sydney PowerPoint Karaoke 3
 
Material Problems And Spiritual Solutions
Material Problems And Spiritual SolutionsMaterial Problems And Spiritual Solutions
Material Problems And Spiritual Solutions
 
Upadesamrita (Text 1)
Upadesamrita (Text 1)Upadesamrita (Text 1)
Upadesamrita (Text 1)
 
Krishna And The Demigods2
Krishna And The Demigods2Krishna And The Demigods2
Krishna And The Demigods2
 
Drupaldelphia 2014 - Standardize Environments with Vagrant
Drupaldelphia 2014 - Standardize Environments with VagrantDrupaldelphia 2014 - Standardize Environments with Vagrant
Drupaldelphia 2014 - Standardize Environments with Vagrant
 

Ähnlich wie Keep calm and vagrant up

BLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docxBLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docxmoirarandell
 
Take Home Your Very Own Free Vagrant CFML Dev Environment
Take Home Your Very Own Free Vagrant CFML Dev Environment Take Home Your Very Own Free Vagrant CFML Dev Environment
Take Home Your Very Own Free Vagrant CFML Dev Environment ColdFusionConference
 
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....Gavin Pickin
 
Drupal 8 - Improving your development workflow
Drupal 8 - Improving your development workflowDrupal 8 - Improving your development workflow
Drupal 8 - Improving your development workflowvaluebound
 
Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environmentbocribbz
 
Vagrant and puppet: Deployment made easy
Vagrant and puppet: Deployment made easyVagrant and puppet: Deployment made easy
Vagrant and puppet: Deployment made easyGeronimo Orozco
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for DevelopersJohn Coggeshall
 
Vagrant workshop 2015
Vagrant workshop 2015Vagrant workshop 2015
Vagrant workshop 2015Haifa Ftirich
 
Step-by-Step Introduction to Apache Flink
Step-by-Step Introduction to Apache Flink Step-by-Step Introduction to Apache Flink
Step-by-Step Introduction to Apache Flink Slim Baltagi
 
Puppet and Vagrant in development
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in developmentAdam Culp
 
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDaysLuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDaysLuis Rodríguez Castromil
 
Vagrant for local and team WordPress Development
Vagrant for local and team WordPress DevelopmentVagrant for local and team WordPress Development
Vagrant for local and team WordPress DevelopmentAnthony Alvarez
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to DockerJulio Martinez
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for DevelopersJohn Coggeshall
 
Puppet Camp Seattle 2014: Docker and Puppet: 1+1=3
Puppet Camp Seattle 2014: Docker and Puppet: 1+1=3 Puppet Camp Seattle 2014: Docker and Puppet: 1+1=3
Puppet Camp Seattle 2014: Docker and Puppet: 1+1=3 Puppet
 
Local development environment through virtualisation
Local development environment through virtualisationLocal development environment through virtualisation
Local development environment through virtualisationRadu Barbu
 
Using Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and JenkinsUsing Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and JenkinsMicael Gallego
 
DevOps: Using Vagrant to Enhance Your Day to Day Development
DevOps: Using Vagrant to Enhance Your Day to Day DevelopmentDevOps: Using Vagrant to Enhance Your Day to Day Development
DevOps: Using Vagrant to Enhance Your Day to Day DevelopmentRob Reynolds
 

Ähnlich wie Keep calm and vagrant up (20)

BLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docxBLCN532 Lab 1Set up your development environmentV2.0.docx
BLCN532 Lab 1Set up your development environmentV2.0.docx
 
Take Home Your Very Own Free Vagrant CFML Dev Environment
Take Home Your Very Own Free Vagrant CFML Dev Environment Take Home Your Very Own Free Vagrant CFML Dev Environment
Take Home Your Very Own Free Vagrant CFML Dev Environment
 
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
Take home your very own free Vagrant CFML Dev Environment - Presented at dev....
 
Drupal 8 - Improving your development workflow
Drupal 8 - Improving your development workflowDrupal 8 - Improving your development workflow
Drupal 8 - Improving your development workflow
 
Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environment
 
Vagrant and puppet: Deployment made easy
Vagrant and puppet: Deployment made easyVagrant and puppet: Deployment made easy
Vagrant and puppet: Deployment made easy
 
Security Testing Using Infrastructure-As-Code
Security Testing Using Infrastructure-As-CodeSecurity Testing Using Infrastructure-As-Code
Security Testing Using Infrastructure-As-Code
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for Developers
 
Vagrant workshop 2015
Vagrant workshop 2015Vagrant workshop 2015
Vagrant workshop 2015
 
Step-by-Step Introduction to Apache Flink
Step-by-Step Introduction to Apache Flink Step-by-Step Introduction to Apache Flink
Step-by-Step Introduction to Apache Flink
 
Puppet and Vagrant in development
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in development
 
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDaysLuisRodriguezLocalDevEnvironmentsDrupalOpenDays
LuisRodriguezLocalDevEnvironmentsDrupalOpenDays
 
Vagrant for local and team WordPress Development
Vagrant for local and team WordPress DevelopmentVagrant for local and team WordPress Development
Vagrant for local and team WordPress Development
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for Developers
 
Puppet Camp Seattle 2014: Docker and Puppet: 1+1=3
Puppet Camp Seattle 2014: Docker and Puppet: 1+1=3 Puppet Camp Seattle 2014: Docker and Puppet: 1+1=3
Puppet Camp Seattle 2014: Docker and Puppet: 1+1=3
 
Local development environment through virtualisation
Local development environment through virtualisationLocal development environment through virtualisation
Local development environment through virtualisation
 
Using Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and JenkinsUsing Docker to build and test in your laptop and Jenkins
Using Docker to build and test in your laptop and Jenkins
 
DevOps: Using Vagrant to Enhance Your Day to Day Development
DevOps: Using Vagrant to Enhance Your Day to Day DevelopmentDevOps: Using Vagrant to Enhance Your Day to Day Development
DevOps: Using Vagrant to Enhance Your Day to Day Development
 
Developing web apps
Developing web appsDeveloping web apps
Developing web apps
 

Kürzlich hochgeladen

Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 

Kürzlich hochgeladen (20)

Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 

Keep calm and vagrant up

  • 1. Keep calm and vagrant up (ok, clear the cache) DrupalSH Meetup June, 19th 2013 Shanghai, China Daniel Lopes http://dgo.to/@dscl
  • 4. 1. Who am I? 2. What is vagrant? 3. Motivations 4. Common vs. Virtualized environments 5. Boxes 6. Provisioning 7. Other points (hands-on) 8. Useful links First, our agenda…
  • 5. Daniel Lopes Brazilian Software Architect living in China since dez/2011 Working with PHP since 1999 (php3) and with Drupal since 2009 (Drupal 6) Drupal Translator and Reviewer for the Brazilian Portuguese team since 2010 http://dgo.to/@dscl http://www.linkedin.com/in/danielscl http://www.facebook.com/danielscl Who am I?
  • 6. What is vagrant? Vagrant is a tool for building complete development environments. With an easy-to-use workflow and focus on automation, Vagrant lowers development environment setup time, increases development/production parity, and makes the "works on my machine" excuse a relic of the past.
  • 7. Create and configure lightweight, reproducible, and portable development environments. - vagrantup.com
  • 8. Motivations… Setting up a fully configured environment for the Drupal Global Training Day attendees to work on as fast as possible and as effortless as possible Anyone, technical or non-technical people, should be able to set it up by following a step-by-step tutorial The solution should be small and lightweight But it should remain useful after the training
  • 9. Real motivations… I heard a lot about Vagrant for development and even for production server, and I was looking for an opportunity to use it! Common ones: ● Upper-case vs. Lower-case ● Windows line break vs. Unix-like line break ● / vs. /my-project ● Different versions of the software (L|W|M)AMP I am tired of having infrastructure related issues within my teams and projects. I want to have an homogenous configuration among my development team. The initial environment setup for new developers takes too long to be done.
  • 10. Common Dev environment Drupal itself runs over a web server (usually, Apache) with PHP on it and a database (usually, MySQL). And all of them can be running on Linux, Windows or MacOS. There are a few installer to help you to configure this in your computer like: For Windows: WAMP - http://www.wampserver.com/en/ For MacOS: MAMP - http://www.mamp.info/en/index.html For Linux? Come on, you have it already by default...
  • 11. Virtualized Dev environment The developer needs to simply load a VM (Virtual Machine) based on Ubuntu using Vagrant and Virtualbox so you have everything running very fast and almost effortless. Required downloads: Virtualbox 4.2+: https://www.virtualbox.org/wiki/Downloads Vagrant 1.2.2: http://downloads.vagrantup.com/tags/v1.2.2 Ubuntu 12.04 box: http://files.vagrantup.com/precise32.box
  • 12. Boxes Boxes are the skeleton from which Vagrant machines are constructed. They are portable files which can be used by others on any platform that runs Vagrant to bring up a working environment. Boxes are provider-specific. Providers are the virtualization tools which are supported by vagrant. So you must obtain the proper box depending on what provider you're using, like: - Virtualbox, which is out-of-the-box in the open-source version; - VMWare. vagrant paid version (http://www.vagrantup.com/vmware); - and even AWS (https://github.com/mitchellh/vagrant-aws).
  • 13. $ vagrant box add base http://files.vagrantup.com/precise32.box $ vagrant init $ vagrant up This is the name of your box. Always use 'base' for your first one.
  • 14. Vagrantfile The only configuration file needed by vagrant to work. It defines the box that the VM will run, as well as several other configuration like: ● config.vm.box_url: URL from where the box can be downloaded. ● config.vm.guest: defines the OS that the VM is running. ● config.vm.network: general network configuration. (details later) ● config.vm.provider: the provider software or platform for this VM. ● config.vm.provision: how is the VM going to be provisioned. ● config.vm.synced_folder: folder to be shared between the host and the VM.
  • 15. Provisioning Provisioning is the action that allows you to install/remove/update software and add or alter any kind of configuration into the VM system while getting it up. Vagrant uses 6 different ways of provisioning, which are: ● Shell script ● Ansible (YAML) ● Chef Solo ● Chef Client ● Puppet apply (serverless) ● Puppet agent But I will show only 2 of them: ● Shell script ● Puppet apply (serverless)
  • 16. Provisioning with Shell Script This is pretty straight-forward shell scripting. You can use it in-line and also create an external file that will be pushed to the VM during the process of getting this up. Heads-up! Keep in mind that every time you hit vagrant up or vagrant reload, this script will be executed. So care about the execution flow of the script commands (if-else, loops, etc)
  • 17. Provisioning with Puppet Puppet is a complete server provisioner that allows you to deeply manage any configuration within your server. You can even control deployments using it. With Vagrant it is used to have a better way to manage the VM configuration and installed software. Puppet have a lot of modules that can be used to add new features to it. Find more about it at: https://forge.puppetlabs.com/
  • 18. Network Vagrant allows you to map ports used by services from inside the VM to port numbers in the host machine. By default, it suggests you to use port number over 2200. It also allows you to use private network, which can use IPs that are only accessible from the host machine. In case you use a private network IP, we'll be able to use ANY port number in the forwarded_port option.
  • 19. Synced folders Vagrant allows you to easily map folders from the host machine (physical) to the guest VM. Great way to keep using your current local projects` files instead of pushing everything to inside the VM. In the following example you can see a way to replace Apache's default docroot ( /var/www ) with your local directory for projects (.. /projects ).
  • 20. Synced folders HEADS UP! ● Note that the local directory is being referenced through a relative path. For this you should consider the directory where the Vagrantfile is as the current directory, then navigate any way you like; ● When dealing with Windows host machines, keep the Vagrantfile and the folder you want to sync in the same partition (e.g.: C: or D:).
  • 21. Packing and Distributing Packing means creating new box files from a machine that is currently present in your system. You can easily pack new boxes from a your current machine using: $ vagrant package [vm-name] –output desired-name.box There are other option for this command to allow you, for instance, pack a Vagrantfile as part of your new box file.
  • 22. Packing and Distributing Distributing means making the box file that you've just created available to your team or to anyone over the Internet. You can push it to github, Dropbox or any other place of your taste, and then send a Pull request to Vagrantbox.es so you can get this added to their list.
  • 23. More about boxes... If you want to, you can even create a new ones from scratch with Veewee (https://github.com/jedi4ever/veewee) From scratch means getting your favorite OS, favorite apps and so on, and put it together. How to use Veewee? Read! http://github.com/jedi4ever/veewee/blob/master/doc/vagrant.md Watch! http://www.youtube.com/watch?v=3vaLTVkKCPI
  • 24. Useful links Vagrant docs: http://docs.vagrantup.com/v2/ Vagrant boxes: http://vagrantbox.es Veewee: https://github.com/jedi4ever/veewee Aegir-up: https://drupal.org/project/aegir-up Puppet docs: http://docs.puppetlabs.com/ Puppet modules: https://forge.puppetlabs.com/