Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Vagrant
Search
Guido Marucci Blas
November 13, 2013
Programming
260
3
Share
Vagrant
Un introducción a Vagrant y alguno tips para un mejor uso
Guido Marucci Blas
November 13, 2013
More Decks by Guido Marucci Blas
See All by Guido Marucci Blas
Código que genera código
guidomb
0
81
Como aplicar la arquitectura de Elm en Swift
guidomb
0
130
A portal from Elm to Swift
guidomb
1
490
Behavior Driven Development
guidomb
0
160
The Ruby Programming Language
guidomb
1
270
MVC, MVVM & MVP ... números romanos o que?
guidomb
4
2.2k
Other Decks in Programming
See All in Programming
エラー処理の温故知新 / history of error handling technic
ryotanakaya
7
1.8k
How We Benchmarked Quarkus: Patterns and anti-patterns
hollycummins
1
180
[RubyKaigi 2026] Require Hooks
palkan
1
290
(Re)make Regexp in Ruby: Democratizing internals for the JIT
makenowjust
3
990
ハーネスエンジニアリングとは?
kinopeee
13
6.7k
ついに来た!本格的なマルチクラウド時代の Google Cloud
maroon1st
0
370
空間オーディオの活用
objectiveaudio
0
120
AIと共に生きる技術選定 2026
sgash708
0
120
Symfony AI in Action - SymfonyLive Berlin 2026
chr_hertel
1
110
JOAI2026 1st solution - heron0519 -
heron0519
0
170
t *testing.T は どこからやってくるの?
otakakot
1
900
アクセシビリティ試験の"その後"を仕組み化する
yuuumiravy
1
190
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
304
21k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.6k
WCS-LA-2024
lcolladotor
0
570
First, design no harm
axbom
PRO
2
1.2k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.1k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
730
The Curse of the Amulet
leimatthew05
1
12k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
380
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
The Curious Case for Waylosing
cassininazir
0
340
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
290
Transcript
Wednesday, November 13, 13
Guido Marucci Blas CTO & Co-Founder at Wolox guidomb
[email protected]
Wednesday, November 13, 13
Permite virtualizar ambientes Es open source Soporta Virtualbox y VMware
Configurable con un DSL en Ruby Multiplataforma Wednesday, November 13, 13
¿Por qué usar Vagrant? Wednesday, November 13, 13
Probar server setups Ambientes de desarrollo replicables Probar cluster de
forma local Wednesday, November 13, 13
Probar server setups Ambientes de desarrollo replicables Probar cluster de
forma local Wednesday, November 13, 13
Projecto A Projecto B Rails 3.2 Ruby 1.9.3 Postgres 8.4
Imagemagick Poppler Rails 4.1 Ruby 2.0.0 Postgres 9.6 Wednesday, November 13, 13
- RRHH: Juan, hoy empieza el nuevo dev para el
proyecto X. ¿Cuáles van a ser sus tareas para la próxima semana? - Juan (PM): Configurar el ambiente Wednesday, November 13, 13
Nos ayuda a bajar la barrera de entrada en un
proyecto Wednesday, November 13, 13
Instalar VirtualBox Instalar Vagrant Configurar Vagrantfile $> vagrant up $>
vagrant ssh $vagrant> Setup Wednesday, November 13, 13
DEMO Wednesday, November 13, 13
Tips Wednesday, November 13, 13
Definir nombre de box por proyecto # -*- mode: ruby
-*- # vi: set ft=ruby : Vagrant.configure("2") do |config| config.vm.box = "vagrant-demo" config.vm.box_url = "http://files.vagrantup.com/precise64.box" # Network config.vm.synced_folder ".", "/vagrant", :nfs => true, id: "vagrant-root" config.vm.network :forwarded_port, guest: 3000, host: 8000 config.vm.network :private_network, ip: "192.168.50.4" end Wednesday, November 13, 13
Usar NFS para sync de archivos # -*- mode: ruby
-*- # vi: set ft=ruby : Vagrant.configure("2") do |config| config.vm.box = "vagrant-demo" config.vm.box_url = "http://files.vagrantup.com/precise64.box" # Network config.vm.synced_folder ".", "/vagrant", :nfs => true, id: "vagrant-root" config.vm.network :forwarded_port, guest: 3000, host: 8000 config.vm.network :private_network, ip: "192.168.50.4" end Wednesday, November 13, 13
Configurar memoria RAM de la VM # -*- mode: ruby
-*- # vi: set ft=ruby : Vagrant.configure("2") do |config| config.vm.box = "vagrant-demo" config.vm.box_url = "http://files.vagrantup.com/precise64.box" config.vm.customize = ["modifyvm", :id, "memory", 1024] # Network config.vm.synced_folder ".", "/vagrant", :nfs => true, id: "vagrant-root" config.vm.network :forwarded_port, guest: 3000, host: 8000 config.vm.network :private_network, ip: "192.168.50.4" end Wednesday, November 13, 13
Exportar la VM configurada $> vagrant up ... SETUP ...
$> vagrant halt $> vagrant package $> mv package.box vagrant-demo.box $> echo "*.box" >> .gitignore $> vagrant box add vagrant-demo ./vagrant-demo.box Wednesday, November 13, 13
DEMO Wednesday, November 13, 13
Berkshelf Chef + + Wednesday, November 13, 13
$> vagrant plugin install vagrant-berkshelf # -*- mode: ruby -*-
# vi: set ft=ruby : Vagrant.configure("2") do |config| config.vm.box = "vagrant-demo-chef" config.vm.box_url = "http://files.vagrantup.com/precise64.box" # Network config.vm.synced_folder ".", "/vagrant", :nfs => true, id: "vagrant-root" config.vm.network :forwarded_port, guest: 3000, host: 8000 config.vm.network :private_network, ip: "192.168.50.4" # Provisioning config.berkshelf.enabled = true config.vm.provision :chef_solo do |chef| chef.add_recipe "apt" chef.add_recipe "build-essential" chef.add_recipe "git" end end Wednesday, November 13, 13
site :opscode cookbook 'apt' cookbook 'build-essential' cookbook 'git' Definir el
Berksfile $>vim Berksfile http://berkshelf.com Wednesday, November 13, 13
$> vagrant plugin install vagrant-omnibus # -*- mode: ruby -*-
# vi: set ft=ruby : Vagrant.configure("2") do |config| config.vm.box = "vagrant-demo-chef" config.vm.box_url = "http://files.vagrantup.com/precise64.box" # Network config.vm.synced_folder ".", "/vagrant", :nfs => true, id: "vagrant-root" config.vm.network :forwarded_port, guest: 3000, host: 8000 config.vm.network :private_network, ip: "192.168.50.4" # Provisioning config.omnibus.chef_version = :latest config.berkshelf.enabled = true config.vm.provision :chef_solo do |chef| chef.add_recipe "apt" chef.add_recipe "build-essential" chef.add_recipe "git" end end Wednesday, November 13, 13
Usar versiones fijas en las cookbooks No actualizar Vagrant a
menos que los plugins soporten la nueva versión ProTip Wednesday, November 13, 13
DEMO Wednesday, November 13, 13
Amazon EC2 + cocina de AMIs = Wednesday, November 13,
13
$> vagrant plugin install vagrant-aws config.vm.define :aws do |aws_config| credentials
= YAML.load_file("./.amazon.yml") aws_config.vm.box = "dummy" aws_config.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box" aws_config.omnibus.chef_version = "10.24.0" aws_config.vm.provider :aws do |aws, override| aws.access_key_id = credentials['access_key_id'] aws.secret_access_key = credentials['secret_access_key'] aws.keypair_name = "APPLICATION_NAME" aws.region = "sa-east-1" aws.region_config "sa-east-1", :ami => "ami-a3da00be" aws.security_groups = ["APPLICATION_NAME"] aws.instance_type = "m1.medium" override.ssh.username = "ubuntu" override.ssh.private_key_path = "~/.ssh/APPLICATION_NAME.pem" end aws_config.vm.provision :chef_solo do |chef| chef.add_recipe 'apt' chef.add_recipe 'application::packages' chef.add_recipe 'nginx::source' chef.add_recipe 'mysql::client' end end $> vagrant up --provider=aws Wednesday, November 13, 13
vagrant halt ¿Preguntas? Wednesday, November 13, 13