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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
38
Learning Lab: WordPress
erikaheidi
0
120
Criando Container Runtimes mais Seguras com Wolfi
erikaheidi
0
190
Introducing Chainguard Images for Safer PHP Runtimes
erikaheidi
0
230
Automatizando documentação em PHP com Autodocs
erikaheidi
0
170
Building the World: The Story Behind Wolfi
erikaheidi
0
800
Hello Wolfi
erikaheidi
1
780
Container Images for the Cloud Native Era
erikaheidi
1
430
Creating Secure Container Images with apko
erikaheidi
0
630
Other Decks in Programming
See All in Programming
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
460
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
140
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
470
Basic Architectures
denyspoltorak
0
680
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
310
Claude Codeと2つの巻き戻し戦略 / Two Rewind Strategies with Claude Code
fruitriin
0
130
ノイジーネイバー問題を解決する 公平なキューイング
occhi
0
100
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
2.6k
高速開発のためのコード整理術
sutetotanuki
1
400
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
1.2k
Best-Practices-for-Cortex-Analyst-and-AI-Agent
ryotaroikeda
1
110
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
200
Featured
See All Featured
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
55
The SEO Collaboration Effect
kristinabergwall1
0
350
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
Automating Front-end Workflow
addyosmani
1371
200k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
420
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
210
What does AI have to do with Human Rights?
axbom
PRO
0
2k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.7k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
180
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
910
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
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