SlideShare a Scribd company logo
Create Development and Production
Environments with Vagrant
Brian P. Hogan
Twitter: @bphogan
Hi. I'm Brian.
— Programmer (http://github.com/napcs)
— Author (http://bphogan.com/publications)
— Engineering Technical Editor @ DigitalOcean
— Musician (http://soundcloud.com/bphogan)
Let's chat today! I want to hear what you're working on.
Roadmap
— Learn about Vagrant
— Create a headless Ubuntu
Server
— Explore provisioning
— Create a Windows 10 box
— Create boxes on
DigitalOcean
Disclaimers and Rules
— This is a talk for people new
to Vagrant.
— This is based on my personal
experience.
— If I go too fast, or I made a
mistake, speak up.
— Ask questions any time.
— If you want to argue, buy me
a beer later.
Vagrant is a tool to provision development environments in virtual
machines. It works on Windows, Linux systems, and macOS.
Vagrant
A tool to provision development environments
— Automates so!ware virtualization
— Uses VirtualBox, VMWare, or libvirt for
virtualization layer
— Runs on Mac, Windows, *nix
Vagrant needs a virtualization layer, so we'll use VirtualBox, from Oracle, cos it's free.
Vagrant uses SSH and if you're on Windows, you'll need PuTTY to log in, and PuTTYgen
to generate keys if you don't have public and private keys yet.
Simplest Setup - Vagrant and VirtualBox
— Vagrant: https://www.vagrantup.com
— VirtualBox: https://virtualbox.org
— On Windows
— PuTTY to log in to SSH
— PuTTYgen for SSH Keygeneration
Using Vagrant
$ vagrant init ubuntu/xenial64
Creates a config file that will tell Vagrant to:
— Download Ubuntu 16.04 Server base image.
— Create VirtualBox virtual machine
— Create an ubuntu user
— Start up SSH on the server
— Mounts current folder to /vagrant
Downloads image, brings up machine.
Firing it up
$ vagrant up
Log in to the machine with the ubuntu user. Let's demo
it.
Using the machine
$ vagrant ssh
ubuntu@ubuntu-xenial:~$
While the machine is provisioning let's look at the
configuration file in detail.
Configuration with Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
# ...
end
Vagrant automatically shares the current working directory.
Sharing a folder
config.vm.synced_folder "./data", "/data"
Forward ports from the guest to the host, for servers and
more.
Forwarding ports
config.vm.network "forwarded_port", guest: 3000, host: 3000
Creating a private network is easy with Vagrant. This
network is private between the guest and the host.
Private network
config.vm.network "private_network", ip: "192.168.33.10"
This creates a public network which lets your guest machine
interact with the rest of your network, just as if it was a real machine.
Bridged networking
config.vm.network "public_network"
The vm.privder block lets you pass configuration options for the provider. For
Virtualbox that means you can specify if you want a GUI, specify the amount of
memory you want to use, and you can also specify CPU and other options.
VirtualBox options
config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
vb.gui = true
# Customize the amount of memory on the VM:
vb.memory = "1024"
end
We can set the name of the machine, the display name in Virtualbox, and the
hostname of the server. We just have to wrap the machine definition in a
vm.define block.
Naming things
Vagrant.configure("2") do |config|
config.vm.define "devbox" do |devbox|
devbox.vm.box = "ubuntu/xenial64"
devbox.vm.hostname = "devbox"
config.vm.network "forwarded_port", guest: 3000, host: 3000
devbox.vm.provider "virtualbox" do |vb|
vb.name = "Devbox"
vb.gui = false
vb.memory = "1024"
end
end
end
Provisioning
— Installing so!ware
— Creating files and folders
— Editing configuration files
— Adding users
Vagrant Provisioner
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -y apache2
SHELL
Demo: Apache Web Server
— Map local folder to server's /
var/www/html folder
— Forward local port 8080 to
port 80 on the server
— Install Apache on the server
The Vagrantfile
Vagrant.configure("2") do |config|
config.vm.define "devbox" do |devbox|
devbox.vm.box = "ubuntu/xenial64"
devbox.vm.hostname = "devbox"
devbox.vm.network "forwarded_port", guest: 80, host: 8080
devbox.vm.synced_folder ".", "/var/www/html"
devbox.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get install -y apache2
SHELL
end
end
Configuration Management with
Ansible
— Define idempotent tasks
— Use declarations instead of
writing scripts
— Define roles (webserver,
database, firewall)
— Use playbooks to provision
machines
An Ansible playbook contains all the stuff we want to do to
our box. This one just installs some things on our server.
Playbook
---
- hosts: all
become: true
tasks:
- name: update apt cache
apt: update_cache=yes
- name: install Apache2
apt: name=apache2 state=present
- name: "Add nano to vim alias"
lineinfile:
path: /home/ubuntu/.bashrc
line: 'alias nano="vim"'
When we run the playbook, it'll go through all of the steps and
apply them to the server. It'll skip anything that's already in place.
Playbook results
PLAY [all] *********************************************************************
TASK [Gathering Facts] *********************************************************
ok: [devbox]
TASK [update apt cache] ********************************************************
changed: [devbox]
TASK [install Apache2] *********************************************************
changed: [devbox]
TASK [Add nano to vim alias] ***************************************************
changed: [devbox]
PLAY RECAP *********************************************************************
devbox : ok=4 changed=3 unreachable=0 failed=0
Vagrant has support for playbooks with the ansible
provisioner.
Provisioning with Ansible
Vagrant.configure("2") do |config|
config.vm.define "devbox" do |devbox|
# ,,,
devbox.vm.provision :ansible do |ansible|
ansible.playbook = "playbook.yml"
end
end
end
Demo: Dev box
— Ubuntu 16.04 LTS
— Apache/MySQL/PHP
— Git/vim
The Vagrantfile has the same setup we had last time, but we'll use the ansible provisioner this
time. Ansible uses Python 2 but Ubuntu 16.04 doesn't include Python2. We can tell Ansible
to use Python 3 using the ansible_python_interpreter option for host_vars.
The Vagrantfile
Vagrant.configure("2") do |config|
config.vm.define "devbox" do |devbox|
devbox.vm.box = "ubuntu/xenial64"
devbox.vm.hostname = "devbox"
devbox.vm.network "forwarded_port", guest: 80, host: 8080
devbox.vm.synced_folder ".", "/var/www/html"
devbox.vm.provision :ansible do |ansible|
ansible.playbook = "playbook.yml"
ansible.host_vars = {
"devbox" => {"ansible_python_interpreter" => "/usr/bin/python3"}
}
end
end
end
Our playbook installs a few pieces of software including
Ruby, MySQL, Git, and Vim.
Playbook
---
- hosts: all
become: true
tasks:
- name: update apt cache
apt: update_cache=yes
- name: install required packages
apt: name={{ item }} state=present
with_items:
- apache2
- mysql-server
- ruby
- git-core
- vim
Vagrant Boxes
Get boxes from https://app.vagrantup.com
Useful boxes:
— scotch/box - Ubuntu 16.04 LAMP server ready to go
— Microso!/EdgeOnWindows10 - Windows 10 with
Edge browser
You can get more Vagrant boxes from the Vagrant Cloud web site, including boxes
that have a bunch of tooling already installed. You can even get a Windows box.
Demo: Windows Dev box
— Test out web sites on Edge
— Run so!ware that only works on Windows
— Run with a GUI
— Uses 120 day evaluation license, FREE and direct
from MS!
Here's how we'd configure a Windows box. We tell Vagrant we're using Windows instead
of Linux, and we specify that we're using WinRM instead of SSH. Then we provide
credentials.
The Vagrantfile
$ vagrant init
Vagrant.configure("2") do |config|
config.vm.define "windowstestbox" do |winbox|
winbox.vm.box = "Microsoft/EdgeOnWindows10"
winbox.vm.guest = :windows
winbox.vm.communicator = :winrm
winbox.winrm.username = "IEUser"
winbox.winrm.password = "Passw0rd!"
winbox.vm.provider "virtualbox" do |vb|
vb.gui = true
vb.memory = "2048"
end
end
end
Vagrant and the Cloud
— Provides
— AWS
— Google
— DigitalOcean
— Build and Provision
Creating virtual machines is great, but you can use Vagrant to
build machines in the cloud using various Vagrant providers.
First, we install the Vagrant plugin. This will let us use a new
provider. We need an API key from DigitalOcean.
Demo: Web Server on DigitalOcean
Install the plugin
$ vagrant plugin install vagrant-digitalocean
Get a DigitalOcean API token from your account and
place it in your environment:
$ export DO_API_KEY=your_api_key
We'll place that API key in an environment variable
and reference that environment variable from our
config. That way we keep it out of configurations we
The config has a lot more info than before. We have to specify our SSH key for
DigitalOcean. We also have to specify information about the kind of server we want to set
up. We configure these through the provider, just like we configured Virtualbox.
Demo: Ubuntu on DigitalOcean
Vagrant.configure('2') do |config|
config.ssh.private_key_path = '~/.ssh/id_rsa'
config.vm.box = 'digital_ocean'
config.vm.box_url = "https://github.com/devopsgroup-
io/vagrant-digitalocean/raw/master/box/digital_ocean.box"
config.vm.define "webserver" do |box|
box.vm.hostname = "webserver"
box.vm.provider :digital_ocean do |provider|
provider.token = ENV["DO_API_KEY"]
provider.image = 'ubuntu-16-04-x64'
provider.region = 'nyc3'
provider.size = '512mb'
provider.private_networking = true
end # provider
end # box
end # config
We can also use provisioning to install stuff on the server.
Provisioning works too!
Vagrant.configure('2') do |config|
# ...
config.vm.define "webserver" do |box|
#...
provider.private_networking = true
box.vm.provision "ansible" do |ansible|
ansible.playbook = "playbook.yml"
ansible.host_vars = {
"webserver" => {"ansible_python_interpreter" => "/usr/bin/python3"}
}
end # ansible
end # box
end # config
Immutable infrastructure
— "Treat servers like cattle, not
pets"
— Don't change an existing
server. Rebuild it
— No "Snowflake" servers
— No "configuration dri#" over
time
— Use images and tools to
rebuild servers and redeploy
apps quickly
Spin up an infrastructure
— Vagrantfile is Ruby code
— Vagrant supports multiple
machines in a single file
— Vagrant commands support
targeting specific machine
— Provisioning runs on all
machines
We define a Ruby array with a hash for each server. The
hash contains the server info we need.
The Vagrantfile
Vagrant.configure('2') do |config|
machines = [
{name: "web1", size: "1GB", image: "ubuntu-16-04-x64", region: "nyc3"},
{name: "web2", size: "1GB", image: "ubuntu-16-04-x64", region: "sfo1"}
]
config.ssh.private_key_path = '~/.ssh/id_rsa'
config.vm.box = 'digital_ocean'
config.vm.box_url = "https://github.com/devopsgroup-io/vagrant-
digitalocean/raw/master/box/digital_ocean.box"
We then iterate over each machine and create a vm.define block. We assign the
name, the region, the image, and the size. We could even use this to assign a
playbook for each machine.
The Vagrantfile
Vagrant.configure('2') do |config|
# ...
machines.each do |machine|
config.vm.define machine[:name] do |box|
box.vm.hostname = machine[:name]
box.vm.provider :digital_ocean do |provider|
provider.token = ENV["DO_API_KEY"]
provider.image = machine[:image]
provider.size = machine[:size]
end
box.vm.provision "ansible" do |ansible|
ansible.playbook = "playbook.yml"
ansible.host_vars = {
machine[:name] => {"ansible_python_interpreter" => "/usr/bin/python3"}
}
end # ansible
end # box
end # loop
end # config
Usage
— vagrant up brings all machines online and provisions
them
— vagrant ssh web1 logs into the webserver
— vagrant provision would re-run the Ansible
playbooks.
— vagrant ssh web1 logs into the db server
— vagrant rebuild rebuilds machines from scratch and
reprovisions
— vagrant destroy removes all machines.
Puphet is a GUI for generating Vagrant configs with provisioning. Pick your
OS, servers you need,. programming languages, and download your bundle.
Puphet
https://puphpet.com/
Terraform, by Hashicorp, is the production solution for building out cloud environments and provisioning them. Docker
Machine can also spin up cloud environments and then install Docker on them, which you can use to host apps
hosted in containers. And Ansible, with a little bit of code and plugins, can create and provision your infrastructure.
Alternatives to Vagrant
— Terraform
— Docker Machine
— Ansible
Summary
— Vagrant controls virtual
machines
— Use Vagrant's provisioner to
set up your machine
— Use existing box images to
save time
— Use Vagrant to build out an
infrastructure in the cloud
Questions
— Slides: https://bphogan.com/presentations/
vagrant2017
— Twitter: @bphogan
— Say hi!
```
Ad

More Related Content

What's hot (20)

serverspecでサーバ環境のテストを書いてみよう
serverspecでサーバ環境のテストを書いてみようserverspecでサーバ環境のテストを書いてみよう
serverspecでサーバ環境のテストを書いてみよう
Daisuke Ikeda
 
CloudNativeな決済サービスの開発と2年間の歩み #sf_A4
CloudNativeな決済サービスの開発と2年間の歩み #sf_A4CloudNativeな決済サービスの開発と2年間の歩み #sf_A4
CloudNativeな決済サービスの開発と2年間の歩み #sf_A4
Junya Suzuki
 
MapFish Print 3
MapFish Print 3MapFish Print 3
MapFish Print 3
Camptocamp
 
NTTデータ流Infrastructure as Code~ 大規模プロジェクトを通して考え抜いた基盤自動化の新たな姿~(NTTデータ テクノロジーカンフ...
NTTデータ流Infrastructure as Code~ 大規模プロジェクトを通して考え抜いた基盤自動化の新たな姿~(NTTデータ テクノロジーカンフ...NTTデータ流Infrastructure as Code~ 大規模プロジェクトを通して考え抜いた基盤自動化の新たな姿~(NTTデータ テクノロジーカンフ...
NTTデータ流Infrastructure as Code~ 大規模プロジェクトを通して考え抜いた基盤自動化の新たな姿~(NTTデータ テクノロジーカンフ...
NTT DATA Technology & Innovation
 
Harbor RegistryのReplication機能
Harbor RegistryのReplication機能Harbor RegistryのReplication機能
Harbor RegistryのReplication機能
Masanori Nara
 
Fiori 使わないと未来はない、SAPGUI撲滅キャンペーン
Fiori 使わないと未来はない、SAPGUI撲滅キャンペーンFiori 使わないと未来はない、SAPGUI撲滅キャンペーン
Fiori 使わないと未来はない、SAPGUI撲滅キャンペーン
Masayuki Sekihara
 
iBeacon を利用したサービス開発のポイント
iBeacon を利用したサービス開発のポイントiBeacon を利用したサービス開発のポイント
iBeacon を利用したサービス開発のポイント
daisuke-a-matsui
 
DCSF19 Hardening Docker daemon with Rootless mode
DCSF19 Hardening Docker daemon with Rootless modeDCSF19 Hardening Docker daemon with Rootless mode
DCSF19 Hardening Docker daemon with Rootless mode
Docker, Inc.
 
Rancher2.0で実現する Managed Kubernetes Service
Rancher2.0で実現する Managed Kubernetes ServiceRancher2.0で実現する Managed Kubernetes Service
Rancher2.0で実現する Managed Kubernetes Service
LINE Corporation
 
誰でもできるスマートシティ向けOSS : FIWAREのはじめかた
誰でもできるスマートシティ向けOSS : FIWAREのはじめかた誰でもできるスマートシティ向けOSS : FIWAREのはじめかた
誰でもできるスマートシティ向けOSS : FIWAREのはじめかた
Shunsuke Kikuchi
 
NSX-Tから見たvSphere with Kubernetesのネットワーキング
NSX-Tから見たvSphere with KubernetesのネットワーキングNSX-Tから見たvSphere with Kubernetesのネットワーキング
NSX-Tから見たvSphere with Kubernetesのネットワーキング
Tomoyuki Tanigaki
 
Project report
Project reportProject report
Project report
meenalpandey
 
「作りこまない IoT 」を実現するためのクラウドネイティブな IoT システム構築 ― Cloud Native Days Tokyo 2018 (Op...
「作りこまない IoT 」を実現するためのクラウドネイティブな IoT システム構築 ― Cloud Native Days Tokyo 2018 (Op...「作りこまない IoT 」を実現するためのクラウドネイティブな IoT システム構築 ― Cloud Native Days Tokyo 2018 (Op...
「作りこまない IoT 」を実現するためのクラウドネイティブな IoT システム構築 ― Cloud Native Days Tokyo 2018 (Op...
SORACOM,INC
 
Web Worker, Service Worker and Worklets
Web Worker, Service Worker and WorkletsWeb Worker, Service Worker and Worklets
Web Worker, Service Worker and Worklets
Keshav Gupta
 
[C16] インメモリ分散KVSの弱点。一貫性が崩れる原因と、それを克服する技術とは? by Taichi Umeda
[C16] インメモリ分散KVSの弱点。一貫性が崩れる原因と、それを克服する技術とは? by Taichi Umeda[C16] インメモリ分散KVSの弱点。一貫性が崩れる原因と、それを克服する技術とは? by Taichi Umeda
[C16] インメモリ分散KVSの弱点。一貫性が崩れる原因と、それを克服する技術とは? by Taichi Umeda
Insight Technology, Inc.
 
オープンソースNW監視ツールのご紹介
オープンソースNW監視ツールのご紹介オープンソースNW監視ツールのご紹介
オープンソースNW監視ツールのご紹介
OSSラボ株式会社
 
「私のkintone 連携には何が最適?」CData Software ソリューションを使うケースは?
「私のkintone 連携には何が最適?」CData Software ソリューションを使うケースは?「私のkintone 連携には何が最適?」CData Software ソリューションを使うケースは?
「私のkintone 連携には何が最適?」CData Software ソリューションを使うケースは?
CData Software Japan
 
Docker国内外本番環境サービス事例のご紹介
Docker国内外本番環境サービス事例のご紹介Docker国内外本番環境サービス事例のご紹介
Docker国内外本番環境サービス事例のご紹介
ThinkIT_impress
 
Web Design Contest.doc
Web Design Contest.docWeb Design Contest.doc
Web Design Contest.doc
butest
 
Quarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java frameworkQuarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java framework
SVDevOps
 
serverspecでサーバ環境のテストを書いてみよう
serverspecでサーバ環境のテストを書いてみようserverspecでサーバ環境のテストを書いてみよう
serverspecでサーバ環境のテストを書いてみよう
Daisuke Ikeda
 
CloudNativeな決済サービスの開発と2年間の歩み #sf_A4
CloudNativeな決済サービスの開発と2年間の歩み #sf_A4CloudNativeな決済サービスの開発と2年間の歩み #sf_A4
CloudNativeな決済サービスの開発と2年間の歩み #sf_A4
Junya Suzuki
 
MapFish Print 3
MapFish Print 3MapFish Print 3
MapFish Print 3
Camptocamp
 
NTTデータ流Infrastructure as Code~ 大規模プロジェクトを通して考え抜いた基盤自動化の新たな姿~(NTTデータ テクノロジーカンフ...
NTTデータ流Infrastructure as Code~ 大規模プロジェクトを通して考え抜いた基盤自動化の新たな姿~(NTTデータ テクノロジーカンフ...NTTデータ流Infrastructure as Code~ 大規模プロジェクトを通して考え抜いた基盤自動化の新たな姿~(NTTデータ テクノロジーカンフ...
NTTデータ流Infrastructure as Code~ 大規模プロジェクトを通して考え抜いた基盤自動化の新たな姿~(NTTデータ テクノロジーカンフ...
NTT DATA Technology & Innovation
 
Harbor RegistryのReplication機能
Harbor RegistryのReplication機能Harbor RegistryのReplication機能
Harbor RegistryのReplication機能
Masanori Nara
 
Fiori 使わないと未来はない、SAPGUI撲滅キャンペーン
Fiori 使わないと未来はない、SAPGUI撲滅キャンペーンFiori 使わないと未来はない、SAPGUI撲滅キャンペーン
Fiori 使わないと未来はない、SAPGUI撲滅キャンペーン
Masayuki Sekihara
 
iBeacon を利用したサービス開発のポイント
iBeacon を利用したサービス開発のポイントiBeacon を利用したサービス開発のポイント
iBeacon を利用したサービス開発のポイント
daisuke-a-matsui
 
DCSF19 Hardening Docker daemon with Rootless mode
DCSF19 Hardening Docker daemon with Rootless modeDCSF19 Hardening Docker daemon with Rootless mode
DCSF19 Hardening Docker daemon with Rootless mode
Docker, Inc.
 
Rancher2.0で実現する Managed Kubernetes Service
Rancher2.0で実現する Managed Kubernetes ServiceRancher2.0で実現する Managed Kubernetes Service
Rancher2.0で実現する Managed Kubernetes Service
LINE Corporation
 
誰でもできるスマートシティ向けOSS : FIWAREのはじめかた
誰でもできるスマートシティ向けOSS : FIWAREのはじめかた誰でもできるスマートシティ向けOSS : FIWAREのはじめかた
誰でもできるスマートシティ向けOSS : FIWAREのはじめかた
Shunsuke Kikuchi
 
NSX-Tから見たvSphere with Kubernetesのネットワーキング
NSX-Tから見たvSphere with KubernetesのネットワーキングNSX-Tから見たvSphere with Kubernetesのネットワーキング
NSX-Tから見たvSphere with Kubernetesのネットワーキング
Tomoyuki Tanigaki
 
「作りこまない IoT 」を実現するためのクラウドネイティブな IoT システム構築 ― Cloud Native Days Tokyo 2018 (Op...
「作りこまない IoT 」を実現するためのクラウドネイティブな IoT システム構築 ― Cloud Native Days Tokyo 2018 (Op...「作りこまない IoT 」を実現するためのクラウドネイティブな IoT システム構築 ― Cloud Native Days Tokyo 2018 (Op...
「作りこまない IoT 」を実現するためのクラウドネイティブな IoT システム構築 ― Cloud Native Days Tokyo 2018 (Op...
SORACOM,INC
 
Web Worker, Service Worker and Worklets
Web Worker, Service Worker and WorkletsWeb Worker, Service Worker and Worklets
Web Worker, Service Worker and Worklets
Keshav Gupta
 
[C16] インメモリ分散KVSの弱点。一貫性が崩れる原因と、それを克服する技術とは? by Taichi Umeda
[C16] インメモリ分散KVSの弱点。一貫性が崩れる原因と、それを克服する技術とは? by Taichi Umeda[C16] インメモリ分散KVSの弱点。一貫性が崩れる原因と、それを克服する技術とは? by Taichi Umeda
[C16] インメモリ分散KVSの弱点。一貫性が崩れる原因と、それを克服する技術とは? by Taichi Umeda
Insight Technology, Inc.
 
オープンソースNW監視ツールのご紹介
オープンソースNW監視ツールのご紹介オープンソースNW監視ツールのご紹介
オープンソースNW監視ツールのご紹介
OSSラボ株式会社
 
「私のkintone 連携には何が最適?」CData Software ソリューションを使うケースは?
「私のkintone 連携には何が最適?」CData Software ソリューションを使うケースは?「私のkintone 連携には何が最適?」CData Software ソリューションを使うケースは?
「私のkintone 連携には何が最適?」CData Software ソリューションを使うケースは?
CData Software Japan
 
Docker国内外本番環境サービス事例のご紹介
Docker国内外本番環境サービス事例のご紹介Docker国内外本番環境サービス事例のご紹介
Docker国内外本番環境サービス事例のご紹介
ThinkIT_impress
 
Web Design Contest.doc
Web Design Contest.docWeb Design Contest.doc
Web Design Contest.doc
butest
 
Quarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java frameworkQuarkus - a next-generation Kubernetes Native Java framework
Quarkus - a next-generation Kubernetes Native Java framework
SVDevOps
 

Similar to Create Development and Production Environments with Vagrant (20)

Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environment
bocribbz
 
Intro to vagrant
Intro to vagrantIntro to vagrant
Intro to vagrant
Mantas Klasavicius
 
Vagrant - Team Development made easy
Vagrant - Team Development made easyVagrant - Team Development made easy
Vagrant - Team Development made easy
Marco Silva
 
Create your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and PackerCreate your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and Packer
frastel
 
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
John Rofrano
 
Vagrant For DevOps
Vagrant For DevOpsVagrant For DevOps
Vagrant For DevOps
Lalatendu Mohanty
 
Quick & Easy Dev Environments with Vagrant
Quick & Easy Dev Environments with VagrantQuick & Easy Dev Environments with Vagrant
Quick & Easy Dev Environments with Vagrant
Joe Ferguson
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for Developers
Antons Kranga
 
Puppet and Vagrant in development
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in development
Adam Culp
 
Vagrant-Overview
Vagrant-OverviewVagrant-Overview
Vagrant-Overview
Crifkin
 
Vagrant
VagrantVagrant
Vagrant
Michael Peacock
 
NetDevOps Developer Environments with Vagrant @ SCALE16x
NetDevOps Developer Environments with Vagrant @ SCALE16xNetDevOps Developer Environments with Vagrant @ SCALE16x
NetDevOps Developer Environments with Vagrant @ SCALE16x
Hank Preston
 
Cooking Perl with Chef: Hello World Tutorial
Cooking Perl with Chef: Hello World TutorialCooking Perl with Chef: Hello World Tutorial
Cooking Perl with Chef: Hello World Tutorial
David Golden
 
Vagrant
VagrantVagrant
Vagrant
ProfessionalVMware
 
Vagrant Up in 5 Easy Steps
Vagrant Up in 5 Easy StepsVagrant Up in 5 Easy Steps
Vagrant Up in 5 Easy Steps
Trevor Roberts Jr.
 
Minicurso de Vagrant
Minicurso de VagrantMinicurso de Vagrant
Minicurso de Vagrant
Leandro Nunes
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
Carlos Sanchez
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Carlos Sanchez
 
Node.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ BenetechNode.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ Benetech
Christopher Bumgardner
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)
Soshi Nemoto
 
Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environment
bocribbz
 
Vagrant - Team Development made easy
Vagrant - Team Development made easyVagrant - Team Development made easy
Vagrant - Team Development made easy
Marco Silva
 
Create your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and PackerCreate your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and Packer
frastel
 
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
John Rofrano
 
Quick & Easy Dev Environments with Vagrant
Quick & Easy Dev Environments with VagrantQuick & Easy Dev Environments with Vagrant
Quick & Easy Dev Environments with Vagrant
Joe Ferguson
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for Developers
Antons Kranga
 
Puppet and Vagrant in development
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in development
Adam Culp
 
Vagrant-Overview
Vagrant-OverviewVagrant-Overview
Vagrant-Overview
Crifkin
 
NetDevOps Developer Environments with Vagrant @ SCALE16x
NetDevOps Developer Environments with Vagrant @ SCALE16xNetDevOps Developer Environments with Vagrant @ SCALE16x
NetDevOps Developer Environments with Vagrant @ SCALE16x
Hank Preston
 
Cooking Perl with Chef: Hello World Tutorial
Cooking Perl with Chef: Hello World TutorialCooking Perl with Chef: Hello World Tutorial
Cooking Perl with Chef: Hello World Tutorial
David Golden
 
Minicurso de Vagrant
Minicurso de VagrantMinicurso de Vagrant
Minicurso de Vagrant
Leandro Nunes
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
Carlos Sanchez
 
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Carlos Sanchez
 
Node.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ BenetechNode.js, Vagrant, Chef, and Mathoid @ Benetech
Node.js, Vagrant, Chef, and Mathoid @ Benetech
Christopher Bumgardner
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)
Soshi Nemoto
 
Ad

More from Brian Hogan (20)

Creating and Deploying Static Sites with Hugo
Creating and Deploying Static Sites with HugoCreating and Deploying Static Sites with Hugo
Creating and Deploying Static Sites with Hugo
Brian Hogan
 
Automating the Cloud with Terraform, and Ansible
Automating the Cloud with Terraform, and AnsibleAutomating the Cloud with Terraform, and Ansible
Automating the Cloud with Terraform, and Ansible
Brian Hogan
 
Docker
DockerDocker
Docker
Brian Hogan
 
Getting Started Contributing To Open Source
Getting Started Contributing To Open SourceGetting Started Contributing To Open Source
Getting Started Contributing To Open Source
Brian Hogan
 
Rethink Frontend Development With Elm
Rethink Frontend Development With ElmRethink Frontend Development With Elm
Rethink Frontend Development With Elm
Brian Hogan
 
Testing Client-side Code with Jasmine and CoffeeScript
Testing Client-side Code with Jasmine and CoffeeScriptTesting Client-side Code with Jasmine and CoffeeScript
Testing Client-side Code with Jasmine and CoffeeScript
Brian Hogan
 
FUD-Free Accessibility for Web Developers - Also, Cake.
FUD-Free Accessibility for Web Developers - Also, Cake.FUD-Free Accessibility for Web Developers - Also, Cake.
FUD-Free Accessibility for Web Developers - Also, Cake.
Brian Hogan
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web Design
Brian Hogan
 
Web Development with CoffeeScript and Sass
Web Development with CoffeeScript and SassWeb Development with CoffeeScript and Sass
Web Development with CoffeeScript and Sass
Brian Hogan
 
Building A Gem From Scratch
Building A Gem From ScratchBuilding A Gem From Scratch
Building A Gem From Scratch
Brian Hogan
 
Intro To Advanced Ruby
Intro To Advanced RubyIntro To Advanced Ruby
Intro To Advanced Ruby
Brian Hogan
 
Turning Passion Into Words
Turning Passion Into WordsTurning Passion Into Words
Turning Passion Into Words
Brian Hogan
 
HTML5 and CSS3 Today
HTML5 and CSS3 TodayHTML5 and CSS3 Today
HTML5 and CSS3 Today
Brian Hogan
 
Web Development With Ruby - From Simple To Complex
Web Development With Ruby - From Simple To ComplexWeb Development With Ruby - From Simple To Complex
Web Development With Ruby - From Simple To Complex
Brian Hogan
 
Stop Reinventing The Wheel - The Ruby Standard Library
Stop Reinventing The Wheel - The Ruby Standard LibraryStop Reinventing The Wheel - The Ruby Standard Library
Stop Reinventing The Wheel - The Ruby Standard Library
Brian Hogan
 
Intro to Ruby
Intro to RubyIntro to Ruby
Intro to Ruby
Brian Hogan
 
Intro to Ruby - Twin Cities Code Camp 7
Intro to Ruby - Twin Cities Code Camp 7Intro to Ruby - Twin Cities Code Camp 7
Intro to Ruby - Twin Cities Code Camp 7
Brian Hogan
 
Make GUI Apps with Shoes
Make GUI Apps with ShoesMake GUI Apps with Shoes
Make GUI Apps with Shoes
Brian Hogan
 
The Why Of Ruby
The Why Of RubyThe Why Of Ruby
The Why Of Ruby
Brian Hogan
 
Story-driven Testing
Story-driven TestingStory-driven Testing
Story-driven Testing
Brian Hogan
 
Creating and Deploying Static Sites with Hugo
Creating and Deploying Static Sites with HugoCreating and Deploying Static Sites with Hugo
Creating and Deploying Static Sites with Hugo
Brian Hogan
 
Automating the Cloud with Terraform, and Ansible
Automating the Cloud with Terraform, and AnsibleAutomating the Cloud with Terraform, and Ansible
Automating the Cloud with Terraform, and Ansible
Brian Hogan
 
Getting Started Contributing To Open Source
Getting Started Contributing To Open SourceGetting Started Contributing To Open Source
Getting Started Contributing To Open Source
Brian Hogan
 
Rethink Frontend Development With Elm
Rethink Frontend Development With ElmRethink Frontend Development With Elm
Rethink Frontend Development With Elm
Brian Hogan
 
Testing Client-side Code with Jasmine and CoffeeScript
Testing Client-side Code with Jasmine and CoffeeScriptTesting Client-side Code with Jasmine and CoffeeScript
Testing Client-side Code with Jasmine and CoffeeScript
Brian Hogan
 
FUD-Free Accessibility for Web Developers - Also, Cake.
FUD-Free Accessibility for Web Developers - Also, Cake.FUD-Free Accessibility for Web Developers - Also, Cake.
FUD-Free Accessibility for Web Developers - Also, Cake.
Brian Hogan
 
Responsive Web Design
Responsive Web DesignResponsive Web Design
Responsive Web Design
Brian Hogan
 
Web Development with CoffeeScript and Sass
Web Development with CoffeeScript and SassWeb Development with CoffeeScript and Sass
Web Development with CoffeeScript and Sass
Brian Hogan
 
Building A Gem From Scratch
Building A Gem From ScratchBuilding A Gem From Scratch
Building A Gem From Scratch
Brian Hogan
 
Intro To Advanced Ruby
Intro To Advanced RubyIntro To Advanced Ruby
Intro To Advanced Ruby
Brian Hogan
 
Turning Passion Into Words
Turning Passion Into WordsTurning Passion Into Words
Turning Passion Into Words
Brian Hogan
 
HTML5 and CSS3 Today
HTML5 and CSS3 TodayHTML5 and CSS3 Today
HTML5 and CSS3 Today
Brian Hogan
 
Web Development With Ruby - From Simple To Complex
Web Development With Ruby - From Simple To ComplexWeb Development With Ruby - From Simple To Complex
Web Development With Ruby - From Simple To Complex
Brian Hogan
 
Stop Reinventing The Wheel - The Ruby Standard Library
Stop Reinventing The Wheel - The Ruby Standard LibraryStop Reinventing The Wheel - The Ruby Standard Library
Stop Reinventing The Wheel - The Ruby Standard Library
Brian Hogan
 
Intro to Ruby - Twin Cities Code Camp 7
Intro to Ruby - Twin Cities Code Camp 7Intro to Ruby - Twin Cities Code Camp 7
Intro to Ruby - Twin Cities Code Camp 7
Brian Hogan
 
Make GUI Apps with Shoes
Make GUI Apps with ShoesMake GUI Apps with Shoes
Make GUI Apps with Shoes
Brian Hogan
 
Story-driven Testing
Story-driven TestingStory-driven Testing
Story-driven Testing
Brian Hogan
 
Ad

Recently uploaded (20)

Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 

Create Development and Production Environments with Vagrant

  • 1. Create Development and Production Environments with Vagrant Brian P. Hogan Twitter: @bphogan
  • 2. Hi. I'm Brian. — Programmer (http://github.com/napcs) — Author (http://bphogan.com/publications) — Engineering Technical Editor @ DigitalOcean — Musician (http://soundcloud.com/bphogan) Let's chat today! I want to hear what you're working on.
  • 3. Roadmap — Learn about Vagrant — Create a headless Ubuntu Server — Explore provisioning — Create a Windows 10 box — Create boxes on DigitalOcean
  • 4. Disclaimers and Rules — This is a talk for people new to Vagrant. — This is based on my personal experience. — If I go too fast, or I made a mistake, speak up. — Ask questions any time. — If you want to argue, buy me a beer later.
  • 5. Vagrant is a tool to provision development environments in virtual machines. It works on Windows, Linux systems, and macOS. Vagrant A tool to provision development environments — Automates so!ware virtualization — Uses VirtualBox, VMWare, or libvirt for virtualization layer — Runs on Mac, Windows, *nix
  • 6. Vagrant needs a virtualization layer, so we'll use VirtualBox, from Oracle, cos it's free. Vagrant uses SSH and if you're on Windows, you'll need PuTTY to log in, and PuTTYgen to generate keys if you don't have public and private keys yet. Simplest Setup - Vagrant and VirtualBox — Vagrant: https://www.vagrantup.com — VirtualBox: https://virtualbox.org — On Windows — PuTTY to log in to SSH — PuTTYgen for SSH Keygeneration
  • 7. Using Vagrant $ vagrant init ubuntu/xenial64 Creates a config file that will tell Vagrant to: — Download Ubuntu 16.04 Server base image. — Create VirtualBox virtual machine — Create an ubuntu user — Start up SSH on the server — Mounts current folder to /vagrant
  • 8. Downloads image, brings up machine. Firing it up $ vagrant up
  • 9. Log in to the machine with the ubuntu user. Let's demo it. Using the machine $ vagrant ssh ubuntu@ubuntu-xenial:~$
  • 10. While the machine is provisioning let's look at the configuration file in detail. Configuration with Vagrantfile Vagrant.configure("2") do |config| config.vm.box = "ubuntu/xenial64" # ... end
  • 11. Vagrant automatically shares the current working directory. Sharing a folder config.vm.synced_folder "./data", "/data"
  • 12. Forward ports from the guest to the host, for servers and more. Forwarding ports config.vm.network "forwarded_port", guest: 3000, host: 3000
  • 13. Creating a private network is easy with Vagrant. This network is private between the guest and the host. Private network config.vm.network "private_network", ip: "192.168.33.10"
  • 14. This creates a public network which lets your guest machine interact with the rest of your network, just as if it was a real machine. Bridged networking config.vm.network "public_network"
  • 15. The vm.privder block lets you pass configuration options for the provider. For Virtualbox that means you can specify if you want a GUI, specify the amount of memory you want to use, and you can also specify CPU and other options. VirtualBox options config.vm.provider "virtualbox" do |vb| # Display the VirtualBox GUI when booting the machine vb.gui = true # Customize the amount of memory on the VM: vb.memory = "1024" end
  • 16. We can set the name of the machine, the display name in Virtualbox, and the hostname of the server. We just have to wrap the machine definition in a vm.define block. Naming things Vagrant.configure("2") do |config| config.vm.define "devbox" do |devbox| devbox.vm.box = "ubuntu/xenial64" devbox.vm.hostname = "devbox" config.vm.network "forwarded_port", guest: 3000, host: 3000 devbox.vm.provider "virtualbox" do |vb| vb.name = "Devbox" vb.gui = false vb.memory = "1024" end end end
  • 17. Provisioning — Installing so!ware — Creating files and folders — Editing configuration files — Adding users
  • 18. Vagrant Provisioner config.vm.provision "shell", inline: <<-SHELL apt-get update apt-get install -y apache2 SHELL
  • 19. Demo: Apache Web Server — Map local folder to server's / var/www/html folder — Forward local port 8080 to port 80 on the server — Install Apache on the server
  • 20. The Vagrantfile Vagrant.configure("2") do |config| config.vm.define "devbox" do |devbox| devbox.vm.box = "ubuntu/xenial64" devbox.vm.hostname = "devbox" devbox.vm.network "forwarded_port", guest: 80, host: 8080 devbox.vm.synced_folder ".", "/var/www/html" devbox.vm.provision "shell", inline: <<-SHELL apt-get update apt-get install -y apache2 SHELL end end
  • 21. Configuration Management with Ansible — Define idempotent tasks — Use declarations instead of writing scripts — Define roles (webserver, database, firewall) — Use playbooks to provision machines
  • 22. An Ansible playbook contains all the stuff we want to do to our box. This one just installs some things on our server. Playbook --- - hosts: all become: true tasks: - name: update apt cache apt: update_cache=yes - name: install Apache2 apt: name=apache2 state=present - name: "Add nano to vim alias" lineinfile: path: /home/ubuntu/.bashrc line: 'alias nano="vim"'
  • 23. When we run the playbook, it'll go through all of the steps and apply them to the server. It'll skip anything that's already in place. Playbook results PLAY [all] ********************************************************************* TASK [Gathering Facts] ********************************************************* ok: [devbox] TASK [update apt cache] ******************************************************** changed: [devbox] TASK [install Apache2] ********************************************************* changed: [devbox] TASK [Add nano to vim alias] *************************************************** changed: [devbox] PLAY RECAP ********************************************************************* devbox : ok=4 changed=3 unreachable=0 failed=0
  • 24. Vagrant has support for playbooks with the ansible provisioner. Provisioning with Ansible Vagrant.configure("2") do |config| config.vm.define "devbox" do |devbox| # ,,, devbox.vm.provision :ansible do |ansible| ansible.playbook = "playbook.yml" end end end
  • 25. Demo: Dev box — Ubuntu 16.04 LTS — Apache/MySQL/PHP — Git/vim
  • 26. The Vagrantfile has the same setup we had last time, but we'll use the ansible provisioner this time. Ansible uses Python 2 but Ubuntu 16.04 doesn't include Python2. We can tell Ansible to use Python 3 using the ansible_python_interpreter option for host_vars. The Vagrantfile Vagrant.configure("2") do |config| config.vm.define "devbox" do |devbox| devbox.vm.box = "ubuntu/xenial64" devbox.vm.hostname = "devbox" devbox.vm.network "forwarded_port", guest: 80, host: 8080 devbox.vm.synced_folder ".", "/var/www/html" devbox.vm.provision :ansible do |ansible| ansible.playbook = "playbook.yml" ansible.host_vars = { "devbox" => {"ansible_python_interpreter" => "/usr/bin/python3"} } end end end
  • 27. Our playbook installs a few pieces of software including Ruby, MySQL, Git, and Vim. Playbook --- - hosts: all become: true tasks: - name: update apt cache apt: update_cache=yes - name: install required packages apt: name={{ item }} state=present with_items: - apache2 - mysql-server - ruby - git-core - vim
  • 28. Vagrant Boxes Get boxes from https://app.vagrantup.com Useful boxes: — scotch/box - Ubuntu 16.04 LAMP server ready to go — Microso!/EdgeOnWindows10 - Windows 10 with Edge browser
  • 29. You can get more Vagrant boxes from the Vagrant Cloud web site, including boxes that have a bunch of tooling already installed. You can even get a Windows box. Demo: Windows Dev box — Test out web sites on Edge — Run so!ware that only works on Windows — Run with a GUI — Uses 120 day evaluation license, FREE and direct from MS!
  • 30. Here's how we'd configure a Windows box. We tell Vagrant we're using Windows instead of Linux, and we specify that we're using WinRM instead of SSH. Then we provide credentials. The Vagrantfile $ vagrant init Vagrant.configure("2") do |config| config.vm.define "windowstestbox" do |winbox| winbox.vm.box = "Microsoft/EdgeOnWindows10" winbox.vm.guest = :windows winbox.vm.communicator = :winrm winbox.winrm.username = "IEUser" winbox.winrm.password = "Passw0rd!" winbox.vm.provider "virtualbox" do |vb| vb.gui = true vb.memory = "2048" end end end
  • 31. Vagrant and the Cloud — Provides — AWS — Google — DigitalOcean — Build and Provision
  • 32. Creating virtual machines is great, but you can use Vagrant to build machines in the cloud using various Vagrant providers. First, we install the Vagrant plugin. This will let us use a new provider. We need an API key from DigitalOcean. Demo: Web Server on DigitalOcean Install the plugin $ vagrant plugin install vagrant-digitalocean Get a DigitalOcean API token from your account and place it in your environment: $ export DO_API_KEY=your_api_key We'll place that API key in an environment variable and reference that environment variable from our config. That way we keep it out of configurations we
  • 33. The config has a lot more info than before. We have to specify our SSH key for DigitalOcean. We also have to specify information about the kind of server we want to set up. We configure these through the provider, just like we configured Virtualbox. Demo: Ubuntu on DigitalOcean Vagrant.configure('2') do |config| config.ssh.private_key_path = '~/.ssh/id_rsa' config.vm.box = 'digital_ocean' config.vm.box_url = "https://github.com/devopsgroup- io/vagrant-digitalocean/raw/master/box/digital_ocean.box" config.vm.define "webserver" do |box| box.vm.hostname = "webserver" box.vm.provider :digital_ocean do |provider| provider.token = ENV["DO_API_KEY"] provider.image = 'ubuntu-16-04-x64' provider.region = 'nyc3' provider.size = '512mb' provider.private_networking = true end # provider end # box end # config
  • 34. We can also use provisioning to install stuff on the server. Provisioning works too! Vagrant.configure('2') do |config| # ... config.vm.define "webserver" do |box| #... provider.private_networking = true box.vm.provision "ansible" do |ansible| ansible.playbook = "playbook.yml" ansible.host_vars = { "webserver" => {"ansible_python_interpreter" => "/usr/bin/python3"} } end # ansible end # box end # config
  • 35. Immutable infrastructure — "Treat servers like cattle, not pets" — Don't change an existing server. Rebuild it — No "Snowflake" servers — No "configuration dri#" over time — Use images and tools to rebuild servers and redeploy apps quickly
  • 36. Spin up an infrastructure — Vagrantfile is Ruby code — Vagrant supports multiple machines in a single file — Vagrant commands support targeting specific machine — Provisioning runs on all machines
  • 37. We define a Ruby array with a hash for each server. The hash contains the server info we need. The Vagrantfile Vagrant.configure('2') do |config| machines = [ {name: "web1", size: "1GB", image: "ubuntu-16-04-x64", region: "nyc3"}, {name: "web2", size: "1GB", image: "ubuntu-16-04-x64", region: "sfo1"} ] config.ssh.private_key_path = '~/.ssh/id_rsa' config.vm.box = 'digital_ocean' config.vm.box_url = "https://github.com/devopsgroup-io/vagrant- digitalocean/raw/master/box/digital_ocean.box"
  • 38. We then iterate over each machine and create a vm.define block. We assign the name, the region, the image, and the size. We could even use this to assign a playbook for each machine. The Vagrantfile Vagrant.configure('2') do |config| # ... machines.each do |machine| config.vm.define machine[:name] do |box| box.vm.hostname = machine[:name] box.vm.provider :digital_ocean do |provider| provider.token = ENV["DO_API_KEY"] provider.image = machine[:image] provider.size = machine[:size] end box.vm.provision "ansible" do |ansible| ansible.playbook = "playbook.yml" ansible.host_vars = { machine[:name] => {"ansible_python_interpreter" => "/usr/bin/python3"} } end # ansible end # box end # loop end # config
  • 39. Usage — vagrant up brings all machines online and provisions them — vagrant ssh web1 logs into the webserver — vagrant provision would re-run the Ansible playbooks. — vagrant ssh web1 logs into the db server — vagrant rebuild rebuilds machines from scratch and reprovisions — vagrant destroy removes all machines.
  • 40. Puphet is a GUI for generating Vagrant configs with provisioning. Pick your OS, servers you need,. programming languages, and download your bundle. Puphet https://puphpet.com/
  • 41. Terraform, by Hashicorp, is the production solution for building out cloud environments and provisioning them. Docker Machine can also spin up cloud environments and then install Docker on them, which you can use to host apps hosted in containers. And Ansible, with a little bit of code and plugins, can create and provision your infrastructure. Alternatives to Vagrant — Terraform — Docker Machine — Ansible
  • 42. Summary — Vagrant controls virtual machines — Use Vagrant's provisioner to set up your machine — Use existing box images to save time — Use Vagrant to build out an infrastructure in the cloud