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
Portable Development Environments with Vagrant
Search
Erika Heidi
September 19, 2014
Programming
1
990
Portable Development Environments with Vagrant
As presented at Hackference 2014
Erika Heidi
September 19, 2014
Tweet
Share
More Decks by Erika Heidi
See All by Erika Heidi
Learning Lab: WordPress
erikaheidi
0
73
Criando Container Runtimes mais Seguras com Wolfi
erikaheidi
0
140
Introducing Chainguard Images for Safer PHP Runtimes
erikaheidi
0
180
Automatizando documentação em PHP com Autodocs
erikaheidi
0
140
Building the World: The Story Behind Wolfi
erikaheidi
0
730
Hello Wolfi
erikaheidi
1
740
Container Images for the Cloud Native Era
erikaheidi
1
390
Creating Secure Container Images with apko
erikaheidi
0
550
Criando GitHub Actions em PHP com Minicli
erikaheidi
0
250
Other Decks in Programming
See All in Programming
システム成長を止めない!本番無停止テーブル移行の全貌
sakawe_ee
1
210
テストから始めるAgentic Coding 〜Claude Codeと共に行うTDD〜 / Agentic Coding starts with testing
rkaga
13
4.9k
Hack Claude Code with Claude Code
choplin
5
2.3k
AI コーディングエージェントの時代へ:JetBrains が描く開発の未来
masaruhr
1
190
Agentic Coding: The Future of Software Development with Agents
mitsuhiko
0
110
チームで開発し事業を加速するための"良い"設計の考え方 @ サポーターズCoLab 2025-07-08
agatan
1
440
git worktree × Claude Code × MCP ~生成AI時代の並列開発フロー~
hisuzuya
1
590
MDN Web Docs に日本語翻訳でコントリビュートしたくなる
ohmori_yusuke
1
130
Claude Code + Container Use と Cursor で作る ローカル並列開発環境のススメ / ccc local dev
kaelaela
10
6k
なんとなくわかった気になるブロックテーマ入門/contents.nagoya 2025 6.28
chiilog
1
280
PipeCDのプラグイン化で目指すところ
warashi
1
280
AIともっと楽するE2Eテスト
myohei
7
2.8k
Featured
See All Featured
Adopting Sorbet at Scale
ufuk
77
9.5k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
126
53k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
Become a Pro
speakerdeck
PRO
29
5.4k
The Straight Up "How To Draw Better" Workshop
denniskardys
235
140k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.3k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
48
2.9k
It's Worth the Effort
3n
185
28k
Into the Great Unknown - MozCon
thekraken
40
1.9k
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.7k
Producing Creativity
orderedlist
PRO
346
40k
Transcript
None
whoami • PHP developer with sysadmin background • Author of
Vagrant Cookbook and phansible.com
What to expect from this talk 1)Vagrant overview 2)Provisioning with
Ansible 3)Useful Resources
Why Vagrant?
None
1.1 Why Vagrant? • Reproducible and portable development environment •
Enables easier code collaboration • Backend env tests / benchmark • Automation Tools learning and testing
None
1.2 Provisioning • Multiple provisioners can be used • Most
common ones: – Puppet – Chef – Ansible – Shell Script
Automation Tools > Shell Script • Right tool for the
job • Clear language • Powerful built-in features • Provisioning can be reused for deployment
1.3 Some Terms • Host / Guest • Provider /
Provisioner • Boxes • Vagrantfile • Synced Folder
1.4 The simplest thing that does something Vagrant.configure("2") do |config|
config.vm.box = "hashicorp/precise64" config.vm.provision "shell", inline: "echo Hello World!" end
None
1.5 Commands • up • reload • provision • suspend
• resume • destroy [ --provision ] [ --provision ]
1.6 Other Vagrant Features • Managing Multiple VMs • Provisioning
to AWS, Digital Ocean, etc • Vagrant Cloud • Vagrant Share / Connect
DEMO 1 Vagrant up
None
2.1 Ansible Overview • Simple and Powerful • Tasks defined
with YAML • Sequential Execution • Modules Directory: Ansible Galaxy • Requires installation of Ansible in the Host
2.2 Vagrantfile Vagrant.configure("2") do |config| config.vm.box = "hashicorp/precise64" config.vm.provision "ansible"
do |ansible| ansible.playbook = "playbook.yml" end end
2.3 The Playbook # playbook.yml --- - hosts: all sudo:
true tasks: - name: Update apt-cache apt: update_cache=yes - name: Install Nginx apt: pkg=nginx state=latest
2.4 Playbook x Manifest (Puppet) #playbook.yml --- - hosts: all
sudo: true tasks: - name: Update apt-cache apt: update_cache=yes - name: Install Nginx apt: pkg=nginx state=latest #default.pp exec { 'apt-get update': command => '/usr/bin/apt-get update' } package { 'nginx': ensure => "installed", require => Exec['apt-get update'], }
2.5 Variables --- - hosts: all sudo: yes vars: web_server:
nginx tasks: - name: Install {{ web_server }} apt: pkg={{ web_server }} state=latest
2.5 Variables - arrays tasks: - name: Install Packages apt:
pkg={{ item }} state=latest with_items: - nginx - php5-fpm - git
2.5 Variables - arrays --- - hosts: all sudo: yes
vars: sys_packages: [ 'nginx', 'php5-fpm', 'git' ] tasks: - name: Install Packages apt: pkg={{ item }} state=latest with_items: sys_packages
DEMO 2 Basic Playbook
None
None
Vagrant Cookbook Special discount coupon for Hackference 2014 http://bit.ly/vc-hack
Questions?
More Vagrant Resources http://erikaheidi.com/vagrant