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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Erika Heidi
September 19, 2014
Programming
1k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Portable Development Environments with Vagrant
As presented at Hackference 2014
Erika Heidi
September 19, 2014
More Decks by Erika Heidi
See All by Erika Heidi
FreeCAD 101 Lightning Talk
erikaheidi
0
83
Learning Lab: WordPress
erikaheidi
0
180
Criando Container Runtimes mais Seguras com Wolfi
erikaheidi
0
240
Introducing Chainguard Images for Safer PHP Runtimes
erikaheidi
0
290
Automatizando documentação em PHP com Autodocs
erikaheidi
0
220
Building the World: The Story Behind Wolfi
erikaheidi
0
870
Hello Wolfi
erikaheidi
1
830
Container Images for the Cloud Native Era
erikaheidi
1
490
Creating Secure Container Images with apko
erikaheidi
0
730
Other Decks in Programming
See All in Programming
MySQLとPostgreSQLって何が違うの?
akagami
0
140
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
280
Detecting Compromised CI with eBPF and Cilium Tetragon
lizrice
0
260
使いながら育てる Claude Code — 開発フローの1コマンド化 × 繰り返し指摘の自動仕組み化
shiki_kakaku
1
2k
承認済みなのに差戻しできてしまうバグ、型で潰せます
shinchit
0
110
Gmail/Google DriveをトリガーにAIエージェントを動かそう! / Run AI agents with Gmail/Google Drive as triggers!
har1101
2
440
AWS Transform Customによる Spring Boot 2.xから4.xへのVerUp
satoshi256kbyte
2
110
TSX の <Hoge<Fuga>> という構文に驚いた話 / tsx-type-argument-syntax
kanaru0928
0
240
「寝てても仕事が進む」Claude Codeで組む第二の脳
tomoyafujita2016
0
360
コンパウンドプロダクト開発のためのローカルプロセスマネージャー再発明 #layerxgo
izumin5210
0
380
Go 1.27 における memory allocation の高速化
andpad
0
330
Loosening the Reins: Go Generics Get More Flexible
kuro_kurorrr
0
340
Featured
See All Featured
Unsuck your backbone
ammeep
672
58k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
450
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
4
500
How to build a perfect <img>
jonoalderson
1
5.9k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
A designer walks into a library…
pauljervisheath
211
24k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
210
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
64
56k
Odyssey Design
rkendrick25
PRO
2
780
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