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 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
Learning Lab: WordPress
erikaheidi
0
75
Criando Container Runtimes mais Seguras com Wolfi
erikaheidi
0
140
Introducing Chainguard Images for Safer PHP Runtimes
erikaheidi
0
190
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
560
Criando GitHub Actions em PHP com Minicli
erikaheidi
0
250
Other Decks in Programming
See All in Programming
可変変数との向き合い方 $$変数名が踊り出す$$ / php conference Variable variables
gunji
0
230
GPUを計算資源として使おう!
primenumber
1
290
知って得する@cloudflare_vite-pluginのあれこれ
chimame
1
120
AIのメモリー
watany
11
950
Streamlitで実現できるようになったこと、実現してくれたこと
ayumu_yamaguchi
2
220
The Niche of CDK Grant オブジェクトって何者?/the-niche-of-cdk-what-isgrant-object
hassaku63
1
690
Googleの新しいコーディングAIエージェントJulesを使ってみた
tonionagauzzi
0
120
Porting a visionOS App to Android XR
akkeylab
0
910
[DevinMeetupTokyo2025] コード書かせないDevinの使い方
takumiyoshikawa
2
140
状態遷移図を書こう / Sequence Chart vs State Diagram
orgachem
PRO
3
250
チームのテスト力を総合的に鍛えて品質、スピード、レジリエンスを共立させる/Testing approach that improves quality, speed, and resilience
goyoki
5
1.2k
Caude codeで爆速開発
codelynx
0
100
Featured
See All Featured
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
282
13k
Embracing the Ebb and Flow
colly
86
4.8k
The Cost Of JavaScript in 2023
addyosmani
51
8.6k
GitHub's CSS Performance
jonrohan
1031
460k
Code Review Best Practice
trishagee
69
19k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Six Lessons from altMBA
skipperchong
28
3.9k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
126
53k
How GitHub (no longer) Works
holman
314
140k
Java REST API Framework Comparison - PWX 2021
mraible
31
8.7k
Unsuck your backbone
ammeep
671
58k
RailsConf 2023
tenderlove
30
1.2k
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