SlideShare uma empresa Scribd logo
1 de 11
Baixar para ler offline
Vagrant
for
Devs

• What is Vagrant for?
• Installation
• Project Setup
• Vagrant Boxes
• Up and Running
• Provisioning
• Teardown
• Wrap Up
• Kill the ‘Works on my Machine’ syndrome
• Dev environments that are:
• Easy to configure
• Reproducible
• Portable
• Disposable
• Self-contained
Why Vagrant?
• Go to http://www.vagrantup.com/downloads
• Download the appropriate package
• Run the installer
• Check the installation:
> vagrant -v
Vagrant 1.6.3
Installation
• Vagrantfile
1. Mark the root directory of your project.
2. Configure the virtual environment:
Type of machine.
Network.
Storage sharing.
Provisioning.
• vagrant init
$ mkdir vagrant_getting_started
$ cd vagrant_getting_started
$ vagrant init
• Commit Vagrantfile to Source Control
Project Setup
It all starts with a base Box!
Atlas Boxes Catalog :https://atlas.hashicorp.com/boxes/search
Vagrantbox.es : http://www.vagrantbox.es
Add a box:
vagrant box add hashicorp/precise32
Use the box:
In Vagrantfile:
Vagrant.configure("2") do |config|
config.vm.box = "hashicorp/precise32"
end
Vagrant Boxes
$ vagrant up
• process the Vagrantfile
• boot and configure the virtual machine
$ vagrant ssh
• full-fledged ssh connection
$ ls /vagrant
• default synced folder
$ vagrant destroy
Up and Running
• Supported provisioning types:
• file, shell, Chef, Puppet, Ansible, Salt, Docker
• Example: Installing Apache
bootstrap.sh :
Vagrantfile:
Vagrant.configure("2") do |config|
config.vm.box = "hashicorp/precise32"
config.vm.provision :shell, path: "bootstrap.sh"
end
#!/usr/bin/env bash
apt-get update
apt-get install -y apache2
if ! [ -L /var/www ]; then
rm -rf /var/www
ln -fs /vagrant /var/www
fi
Provisioning
$ vagrant suspend
save the state and pause the machine
$ vagrant halt
gracefully shutdown the machine
$ vagrant destroy
erase all trace of the guest machine
Teardown
• Self-contained Dependencies
• Your environment is part of your codebase
• Vagrantfile is all you need.
• Download a base box or create one and share.
• Work with any virtualisation provider.
• Never look back!
Wrap Up
Ant(on) Weiss
DevOps Evangelist&Enabler, CI/CD/ALM Expert
now at PrimaryData Inc.
ant.weiss@gmail.com
twitter: @antweiss
http://otomato.wordpress.com

Mais conteúdo relacionado

Mais procurados

Vagrant: The ability to create production environments from day 1 of development
Vagrant: The ability to create production environments from day 1 of developmentVagrant: The ability to create production environments from day 1 of development
Vagrant: The ability to create production environments from day 1 of development
Paul Stack
 
How do i update the crawford slackware box so that it is running the most up ...
How do i update the crawford slackware box so that it is running the most up ...How do i update the crawford slackware box so that it is running the most up ...
How do i update the crawford slackware box so that it is running the most up ...
Alexander Bitar
 
How we found a firewall vendor bug using Teleport as a bastion jump host
How we found a firewall vendor bug using Teleport as a bastion jump hostHow we found a firewall vendor bug using Teleport as a bastion jump host
How we found a firewall vendor bug using Teleport as a bastion jump host
Faelix Ltd
 
From Hello World to Real World - Container Days Boston 2016
From Hello World to Real World - Container Days Boston 2016From Hello World to Real World - Container Days Boston 2016
From Hello World to Real World - Container Days Boston 2016
Shannon Williams
 

Mais procurados (20)

Vagrant: The ability to create production environments from day 1 of development
Vagrant: The ability to create production environments from day 1 of developmentVagrant: The ability to create production environments from day 1 of development
Vagrant: The ability to create production environments from day 1 of development
 
Development with Vagrant
Development with VagrantDevelopment with Vagrant
Development with Vagrant
 
Dev Talk: Event Manipulation and Testing
Dev Talk: Event Manipulation and TestingDev Talk: Event Manipulation and Testing
Dev Talk: Event Manipulation and Testing
 
Next Gen Storage and Networking in Container Environments - September 2016 Ra...
Next Gen Storage and Networking in Container Environments - September 2016 Ra...Next Gen Storage and Networking in Container Environments - September 2016 Ra...
Next Gen Storage and Networking in Container Environments - September 2016 Ra...
 
Vagrant to-aws-flow
Vagrant to-aws-flowVagrant to-aws-flow
Vagrant to-aws-flow
 
Running Rancher and Docker on Dev Machines - Rancher Online Meetup - May 2016
Running Rancher and Docker on Dev Machines - Rancher Online Meetup - May 2016Running Rancher and Docker on Dev Machines - Rancher Online Meetup - May 2016
Running Rancher and Docker on Dev Machines - Rancher Online Meetup - May 2016
 
Implementing a Database and API for your Cloud Service
Implementing a Database and API for your Cloud ServiceImplementing a Database and API for your Cloud Service
Implementing a Database and API for your Cloud Service
 
Rancher March 2016 Online Meetup Containers-as-a-Service with Rancher 1.0
Rancher March 2016 Online Meetup Containers-as-a-Service with Rancher 1.0Rancher March 2016 Online Meetup Containers-as-a-Service with Rancher 1.0
Rancher March 2016 Online Meetup Containers-as-a-Service with Rancher 1.0
 
Dear IT...I'd Like A Kubernetes Cluster
Dear IT...I'd Like A Kubernetes ClusterDear IT...I'd Like A Kubernetes Cluster
Dear IT...I'd Like A Kubernetes Cluster
 
Building a Scalable CI Platform using Docker, Drone and Rancher
Building a Scalable CI  Platform using Docker, Drone and RancherBuilding a Scalable CI  Platform using Docker, Drone and Rancher
Building a Scalable CI Platform using Docker, Drone and Rancher
 
How do i update the crawford slackware box so that it is running the most up ...
How do i update the crawford slackware box so that it is running the most up ...How do i update the crawford slackware box so that it is running the most up ...
How do i update the crawford slackware box so that it is running the most up ...
 
How we found a firewall vendor bug using Teleport as a bastion jump host
How we found a firewall vendor bug using Teleport as a bastion jump hostHow we found a firewall vendor bug using Teleport as a bastion jump host
How we found a firewall vendor bug using Teleport as a bastion jump host
 
Deploying Containers with Rancher
Deploying Containers with RancherDeploying Containers with Rancher
Deploying Containers with Rancher
 
From Hello World to Real World - Container Days Boston 2016
From Hello World to Real World - Container Days Boston 2016From Hello World to Real World - Container Days Boston 2016
From Hello World to Real World - Container Days Boston 2016
 
Launching Python Cloud Services for AI/IoT Projects
Launching Python Cloud Services for AI/IoT ProjectsLaunching Python Cloud Services for AI/IoT Projects
Launching Python Cloud Services for AI/IoT Projects
 
Drone your Ansible
Drone your AnsibleDrone your Ansible
Drone your Ansible
 
OpenStack Contribution Workflow
OpenStack Contribution WorkflowOpenStack Contribution Workflow
OpenStack Contribution Workflow
 
Tips, Tricks and Tools for Running Containers Like a Pro - Rancher Labs April...
Tips, Tricks and Tools for Running Containers Like a Pro - Rancher Labs April...Tips, Tricks and Tools for Running Containers Like a Pro - Rancher Labs April...
Tips, Tricks and Tools for Running Containers Like a Pro - Rancher Labs April...
 
Continuous Delivery at Gogo with Spinnaker and Foremast
Continuous Delivery at Gogo with Spinnaker and ForemastContinuous Delivery at Gogo with Spinnaker and Foremast
Continuous Delivery at Gogo with Spinnaker and Foremast
 
Account creation lab guide
Account creation lab guideAccount creation lab guide
Account creation lab guide
 

Semelhante a Vagrant in 15 minutes

Powering Development and Testing Environments with Vagrant
Powering Development and Testing Environments with VagrantPowering Development and Testing Environments with Vagrant
Powering Development and Testing Environments with Vagrant
Coen Jacobs
 
Avoiding surprises with Chef and Vagrant
Avoiding surprises with Chef and VagrantAvoiding surprises with Chef and Vagrant
Avoiding surprises with Chef and Vagrant
andygale
 

Semelhante a Vagrant in 15 minutes (20)

Powering Development and Testing Environments with Vagrant
Powering Development and Testing Environments with VagrantPowering Development and Testing Environments with Vagrant
Powering Development and Testing Environments with Vagrant
 
Varying WordPress Development Environment WordCamp Columbus 2016
Varying WordPress Development Environment WordCamp Columbus 2016Varying WordPress Development Environment WordCamp Columbus 2016
Varying WordPress Development Environment WordCamp Columbus 2016
 
Varying wordpressdevelopmentenvironment wp-campus2016
Varying wordpressdevelopmentenvironment wp-campus2016Varying wordpressdevelopmentenvironment wp-campus2016
Varying wordpressdevelopmentenvironment wp-campus2016
 
Vagrant + Docker
Vagrant + DockerVagrant + Docker
Vagrant + Docker
 
Vagrant-Overview
Vagrant-OverviewVagrant-Overview
Vagrant-Overview
 
Vagrant 101 Workshop
Vagrant 101 WorkshopVagrant 101 Workshop
Vagrant 101 Workshop
 
Varying WordPress Development Environment WordCamp Cincinnati 2016
Varying WordPress Development Environment WordCamp Cincinnati 2016Varying WordPress Development Environment WordCamp Cincinnati 2016
Varying WordPress Development Environment WordCamp Cincinnati 2016
 
Vagrant and Chef on FOSSASIA 2014
Vagrant and Chef on FOSSASIA 2014Vagrant and Chef on FOSSASIA 2014
Vagrant and Chef on FOSSASIA 2014
 
Improved development workflows using vagrant
Improved development workflows using vagrantImproved development workflows using vagrant
Improved development workflows using vagrant
 
Professional WordPress Development with Vagrant - Andrea Cardinali - WordCam...
Professional WordPress Development with Vagrant - Andrea Cardinali -  WordCam...Professional WordPress Development with Vagrant - Andrea Cardinali -  WordCam...
Professional WordPress Development with Vagrant - Andrea Cardinali - WordCam...
 
Devoxx UK 2013: Sandboxing with the Vagrant-Binding API
Devoxx UK 2013: Sandboxing with the Vagrant-Binding APIDevoxx UK 2013: Sandboxing with the Vagrant-Binding API
Devoxx UK 2013: Sandboxing with the Vagrant-Binding API
 
Using Vagrant, Puppet, Testing & Hadoop
Using Vagrant, Puppet, Testing & HadoopUsing Vagrant, Puppet, Testing & Hadoop
Using Vagrant, Puppet, Testing & Hadoop
 
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & HadoopPuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
 
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & HadoopPuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
 
Making Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and DockerMaking Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and Docker
 
Vagrant & Docker
Vagrant & DockerVagrant & Docker
Vagrant & Docker
 
Avoiding surprises with Chef and Vagrant
Avoiding surprises with Chef and VagrantAvoiding surprises with Chef and Vagrant
Avoiding surprises with Chef and Vagrant
 
Using Vagrant
Using VagrantUsing Vagrant
Using Vagrant
 
Vagrant and docker
Vagrant and dockerVagrant and docker
Vagrant and docker
 
WordPress Development with VVV, VV, and Vagrant
WordPress Development with VVV, VV, and VagrantWordPress Development with VVV, VV, and Vagrant
WordPress Development with VVV, VV, and Vagrant
 

Mais de Anton Weiss

The New Science of Software Delivery
The New Science of Software DeliveryThe New Science of Software Delivery
The New Science of Software Delivery
Anton Weiss
 
Continuous Delivery for Mobile R&D
Continuous Delivery for Mobile R&DContinuous Delivery for Mobile R&D
Continuous Delivery for Mobile R&D
Anton Weiss
 

Mais de Anton Weiss (20)

The New Science of Software Delivery
The New Science of Software DeliveryThe New Science of Software Delivery
The New Science of Software Delivery
 
Escaping the Jungle - Migrating to Cloud Native CI/CD
Escaping the Jungle - Migrating to Cloud Native CI/CDEscaping the Jungle - Migrating to Cloud Native CI/CD
Escaping the Jungle - Migrating to Cloud Native CI/CD
 
Envoy, Wasm and Rust - the Mighty Trio
Envoy, Wasm and Rust -  the Mighty TrioEnvoy, Wasm and Rust -  the Mighty Trio
Envoy, Wasm and Rust - the Mighty Trio
 
Dumb Services in Smart Nets - istio
Dumb Services in Smart Nets -  istioDumb Services in Smart Nets -  istio
Dumb Services in Smart Nets - istio
 
WTF Do We Need a Service Mesh?
WTF Do We Need a Service Mesh? WTF Do We Need a Service Mesh?
WTF Do We Need a Service Mesh?
 
Many Changes Little Fun
Many Changes Little Fun Many Changes Little Fun
Many Changes Little Fun
 
Optimizing the Delivery Pipeline for Flow
Optimizing the Delivery Pipeline for FlowOptimizing the Delivery Pipeline for Flow
Optimizing the Delivery Pipeline for Flow
 
A Deeper Look at Cargo
A Deeper Look at CargoA Deeper Look at Cargo
A Deeper Look at Cargo
 
Heralding change - How to Get Engineers On Board the DevOps Ship
Heralding change - How to Get Engineers On Board the DevOps ShipHeralding change - How to Get Engineers On Board the DevOps Ship
Heralding change - How to Get Engineers On Board the DevOps Ship
 
When Your Pipelines Are a Mess
When Your Pipelines Are a MessWhen Your Pipelines Are a Mess
When Your Pipelines Are a Mess
 
Wiring up microservices with Istio
Wiring up microservices with IstioWiring up microservices with Istio
Wiring up microservices with Istio
 
ChatOps - the Road to a Collaborative CLI
ChatOps  - the Road to a Collaborative CLI ChatOps  - the Road to a Collaborative CLI
ChatOps - the Road to a Collaborative CLI
 
The Road to a Hybrid, Transparent Pipeline
The Road to a Hybrid, Transparent PipelineThe Road to a Hybrid, Transparent Pipeline
The Road to a Hybrid, Transparent Pipeline
 
Jenkins and the Future of Software Delivery
Jenkins and the Future of Software DeliveryJenkins and the Future of Software Delivery
Jenkins and the Future of Software Delivery
 
How Openstack is Built
How Openstack is BuiltHow Openstack is Built
How Openstack is Built
 
Continuous Delivery is Not a Commodity
Continuous Delivery is Not a CommodityContinuous Delivery is Not a Commodity
Continuous Delivery is Not a Commodity
 
Grooving with Jenkins
Grooving with JenkinsGrooving with Jenkins
Grooving with Jenkins
 
Ninja, Choose Your Weapon!
Ninja, Choose Your Weapon!Ninja, Choose Your Weapon!
Ninja, Choose Your Weapon!
 
DevOps - Transparency & Self Service
DevOps - Transparency & Self ServiceDevOps - Transparency & Self Service
DevOps - Transparency & Self Service
 
Continuous Delivery for Mobile R&D
Continuous Delivery for Mobile R&DContinuous Delivery for Mobile R&D
Continuous Delivery for Mobile R&D
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

Vagrant in 15 minutes

  • 2. • What is Vagrant for? • Installation • Project Setup • Vagrant Boxes • Up and Running • Provisioning • Teardown • Wrap Up
  • 3. • Kill the ‘Works on my Machine’ syndrome • Dev environments that are: • Easy to configure • Reproducible • Portable • Disposable • Self-contained Why Vagrant?
  • 4. • Go to http://www.vagrantup.com/downloads • Download the appropriate package • Run the installer • Check the installation: > vagrant -v Vagrant 1.6.3 Installation
  • 5. • Vagrantfile 1. Mark the root directory of your project. 2. Configure the virtual environment: Type of machine. Network. Storage sharing. Provisioning. • vagrant init $ mkdir vagrant_getting_started $ cd vagrant_getting_started $ vagrant init • Commit Vagrantfile to Source Control Project Setup
  • 6. It all starts with a base Box! Atlas Boxes Catalog :https://atlas.hashicorp.com/boxes/search Vagrantbox.es : http://www.vagrantbox.es Add a box: vagrant box add hashicorp/precise32 Use the box: In Vagrantfile: Vagrant.configure("2") do |config| config.vm.box = "hashicorp/precise32" end Vagrant Boxes
  • 7. $ vagrant up • process the Vagrantfile • boot and configure the virtual machine $ vagrant ssh • full-fledged ssh connection $ ls /vagrant • default synced folder $ vagrant destroy Up and Running
  • 8. • Supported provisioning types: • file, shell, Chef, Puppet, Ansible, Salt, Docker • Example: Installing Apache bootstrap.sh : Vagrantfile: Vagrant.configure("2") do |config| config.vm.box = "hashicorp/precise32" config.vm.provision :shell, path: "bootstrap.sh" end #!/usr/bin/env bash apt-get update apt-get install -y apache2 if ! [ -L /var/www ]; then rm -rf /var/www ln -fs /vagrant /var/www fi Provisioning
  • 9. $ vagrant suspend save the state and pause the machine $ vagrant halt gracefully shutdown the machine $ vagrant destroy erase all trace of the guest machine Teardown
  • 10. • Self-contained Dependencies • Your environment is part of your codebase • Vagrantfile is all you need. • Download a base box or create one and share. • Work with any virtualisation provider. • Never look back! Wrap Up
  • 11. Ant(on) Weiss DevOps Evangelist&Enabler, CI/CD/ALM Expert now at PrimaryData Inc. ant.weiss@gmail.com twitter: @antweiss http://otomato.wordpress.com