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
42
Criando Container Runtimes mais Seguras com Wolfi
erikaheidi
0
110
Introducing Chainguard Images for Safer PHP Runtimes
erikaheidi
0
150
Automatizando documentação em PHP com Autodocs
erikaheidi
0
110
Building the World: The Story Behind Wolfi
erikaheidi
0
610
Hello Wolfi
erikaheidi
1
690
Container Images for the Cloud Native Era
erikaheidi
1
360
Creating Secure Container Images with apko
erikaheidi
0
510
Criando GitHub Actions em PHP com Minicli
erikaheidi
0
230
Other Decks in Programming
See All in Programming
color-scheme: light dark; を完全に理解する
uhyo
5
400
dbt Pythonモデルで実現するSnowflake活用術
trsnium
0
180
時計仕掛けのCompose
mkeeda
1
300
Honoをフロントエンドで使う 3つのやり方
yusukebe
7
3.3k
コミュニティ駆動 AWS CDK ライブラリ「Open Constructs Library」 / community-cdk-library
gotok365
2
140
昭和の職場からアジャイルの世界へ
kumagoro95
1
380
なぜイベント駆動が必要なのか - CQRS/ESで解く複雑系システムの課題 -
j5ik2o
12
4.1k
Honoのおもしろいミドルウェアをみてみよう
yusukebe
1
210
Introduction to kotlinx.rpc
arawn
0
700
『GO』アプリ バックエンドサーバのコスト削減
mot_techtalk
0
150
ペアーズでの、Langfuseを中心とした評価ドリブンなリリースサイクルのご紹介
fukubaka0825
2
330
クリーンアーキテクチャから見る依存の向きの大切さ
shimabox
2
510
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.1k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
The Cult of Friendly URLs
andyhume
78
6.2k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
Building Applications with DynamoDB
mza
93
6.2k
Speed Design
sergeychernyshev
27
790
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.2k
GitHub's CSS Performance
jonrohan
1030
460k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3k
Become a Pro
speakerdeck
PRO
26
5.1k
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