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
18
Criando Container Runtimes mais Seguras com Wolfi
erikaheidi
0
69
Introducing Chainguard Images for Safer PHP Runtimes
erikaheidi
0
120
Automatizando documentação em PHP com Autodocs
erikaheidi
0
79
Building the World: The Story Behind Wolfi
erikaheidi
0
520
Hello Wolfi
erikaheidi
1
650
Container Images for the Cloud Native Era
erikaheidi
1
330
Creating Secure Container Images with apko
erikaheidi
0
450
Criando GitHub Actions em PHP com Minicli
erikaheidi
0
200
Other Decks in Programming
See All in Programming
◯◯エンジニアになった理由
gessy0129
PRO
0
650
Rails 8 Frontend: 10 commandments & 7 deadly sins in 2025
yshmarov
1
630
ポケモンで考えるコミュニケーション / Communication Lessons from Pokémon
mackey0225
4
170
5年分のツケを一気に払った話
soogie
3
1.3k
CSC509 Lecture 02
javiergs
PRO
0
160
CDKを活用した 大規模コンテナ移行 プロジェクトの紹介
yoyoyopg
0
300
2024-10-01 dev2next - Observability for Modern JVM Applications
jonatan_ivanov
0
110
Introduce dRuby
ledsun
0
100
App Router 悲喜交々
quramy
7
380
NEWTにおけるiOS18対応の進め方
ryu1sazae
0
230
ROS 2のZenoh対応とZenohのROS 2対応
takasehideki
2
300
Micro Frontends for Java Microservices - dev2next 2024
mraible
PRO
0
200
Featured
See All Featured
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
231
17k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
46
4.9k
Building Adaptive Systems
keathley
38
2.1k
Designing on Purpose - Digital PM Summit 2013
jponch
114
6.9k
Design by the Numbers
sachag
278
19k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Mobile First: as difficult as doing things right
swwweet
222
8.8k
How STYLIGHT went responsive
nonsquared
95
5.1k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
92
16k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
7.5k
Designing the Hi-DPI Web
ddemaree
280
34k
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