$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Portable Environments with Vagrant
Search
Erika Heidi
August 29, 2014
Programming
8
1.8k
Portable Environments with Vagrant
Portable Development Environments with Vagrant (and Ansible) - LaraconEU 2014
Erika Heidi
August 29, 2014
Tweet
Share
More Decks by Erika Heidi
See All by Erika Heidi
FreeCAD 101 Lightning Talk
erikaheidi
0
35
Learning Lab: WordPress
erikaheidi
0
110
Criando Container Runtimes mais Seguras com Wolfi
erikaheidi
0
180
Introducing Chainguard Images for Safer PHP Runtimes
erikaheidi
0
220
Automatizando documentação em PHP com Autodocs
erikaheidi
0
170
Building the World: The Story Behind Wolfi
erikaheidi
0
780
Hello Wolfi
erikaheidi
1
770
Container Images for the Cloud Native Era
erikaheidi
1
420
Creating Secure Container Images with apko
erikaheidi
0
610
Other Decks in Programming
See All in Programming
UIデザインに役立つ 2025年の最新CSS / The Latest CSS for UI Design 2025
clockmaker
18
7.6k
Python札幌 LT資料
t3tra
6
990
ゲームの物理 剛体編
fadis
0
360
Jetpack XR SDKから紐解くAndroid XR開発と技術選定のヒント / about-androidxr-and-jetpack-xr-sdk
drumath2237
1
160
非同期処理の迷宮を抜ける: 初学者がつまづく構造的な原因
pd1xx
1
740
Canon EOS R50 V と R5 Mark II 購入でみえてきた最近のデジイチ VR180 事情、そして VR180 静止画に活路を見出すまで
karad
0
130
Microservices rules: What good looks like
cer
PRO
0
1.6k
Full-Cycle Reactivity in Angular: SignalStore mit Signal Forms und Resources
manfredsteyer
PRO
0
160
SwiftUIで本格音ゲー実装してみた
hypebeans
0
460
手が足りない!兼業データエンジニアに必要だったアーキテクチャと立ち回り
zinkosuke
0
790
ゆくKotlin くるRust
exoego
1
130
AIエージェントを活かすPM術 AI駆動開発の現場から
gyuta
0
450
Featured
See All Featured
More Than Pixels: Becoming A User Experience Designer
marktimemedia
2
250
sira's awesome portfolio website redesign presentation
elsirapls
0
87
Docker and Python
trallard
47
3.7k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
1
19
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Become a Pro
speakerdeck
PRO
31
5.7k
Designing for Performance
lara
610
69k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.1k
We Are The Robots
honzajavorek
0
110
Leadership Guide Workshop - DevTernity 2021
reverentgeek
0
160
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
980
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
86
Transcript
None
whoami • PHP developer with sysadmin background • Author of
Vagrant Cookbook on LeanPub 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
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 ]
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 Laracon EU 2014 http://bit.ly/vc-laracon
Questions?
More Vagrant Resources http://erikaheidi.com/vagrant Please Rate this Talk! https://joind.in/11689