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
1k
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
FreeCAD 101 Lightning Talk
erikaheidi
0
21
Learning Lab: WordPress
erikaheidi
0
82
Criando Container Runtimes mais Seguras com Wolfi
erikaheidi
0
150
Introducing Chainguard Images for Safer PHP Runtimes
erikaheidi
0
200
Automatizando documentação em PHP com Autodocs
erikaheidi
0
150
Building the World: The Story Behind Wolfi
erikaheidi
0
750
Hello Wolfi
erikaheidi
1
750
Container Images for the Cloud Native Era
erikaheidi
1
400
Creating Secure Container Images with apko
erikaheidi
0
570
Other Decks in Programming
See All in Programming
1から理解するWeb Push
dora1998
7
1.9k
CloudflareのChat Agent Starter Kitで簡単!AIチャットボット構築
syumai
2
500
プロパティベーステストによるUIテスト: LLMによるプロパティ定義生成でエッジケースを捉える
tetta_pdnt
0
1.7k
Processing Gem ベースの、2D レトロゲームエンジンの開発
tokujiros
2
130
旅行プランAIエージェント開発の裏側
ippo012
2
910
Introducing ReActionView: A new ActionView-compatible ERB Engine @ Rails World 2025, Amsterdam
marcoroth
0
690
JSONataを使ってみよう Step Functionsが楽しくなる実践テクニック #devio2025
dafujii
1
530
AIと私たちの学習の変化を考える - Claude Codeの学習モードを例に
azukiazusa1
10
4.2k
Cache Me If You Can
ryunen344
2
1.4k
Deep Dive into Kotlin Flow
jmatsu
1
350
AI時代のUIはどこへ行く?
yusukebe
18
8.9k
複雑なフォームに立ち向かう Next.js の技術選定
macchiitaka
2
130
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
59
9.5k
Why Our Code Smells
bkeepers
PRO
339
57k
How GitHub (no longer) Works
holman
315
140k
Building a Modern Day E-commerce SEO Strategy
aleyda
43
7.6k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
31
2.2k
Testing 201, or: Great Expectations
jmmastey
45
7.7k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
840
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
51
5.6k
Imperfection Machines: The Place of Print at Facebook
scottboms
268
13k
Music & Morning Musume
bryan
46
6.8k
BBQ
matthewcrist
89
9.8k
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