SlideShare a Scribd company logo
Local development with Vagrant 
Andriy Podanenko 
Software Architect, DevOp 
Propeople 
@podarok
Plan 
● What is Vagrant? 
● Provisioning, puppet, ansible 
● Generating configs with puphpet.com 
● How puphpet.com works internally
What is Vagrant 
● Layer on top ov virtual machine providers 
− Virtualbox 
− Vmware 
● Command line tool 
● Text file to control the settings 
● Plenty of boxes available on internet
Vagrant commands 
● vagrant up 
● vagrant ssh 
● vagrant provision 
● vagrant halt 
● vagrant destroy 
● vagrant reload --provision
Vagrant up workflow 
-> vagrant up 
● Obtaining vagrant box (vm image) - once 
● Starting virtualbox (vm provider) 
● Starting provisioners stack - first time and with 
--provision or when -> vagrant provision 
-> vm box up and running 
-> vagrant ssh
Vagrant configuration 
● Ruby syntax 
● Box, ram, cpu 
Vagrant.configure("2") do |config| 
config.vm.box = 'ubuntu-1404' 
config.vm.box_url = 'http://.../ubuntu-1404-x64.box' 
config.vm.provider :virtualbox do |vb| 
vb.customize ["modifyvm", :id, "--memory", "2048"] 
vb.customize ["modifyvm", :id, "--cpus", "2"] 
end 
end
Vagrant boxes 
● https://vagrantcloud.com 
● http://www.vagrantbox.es
Vagrant configuration 
● Network 
Vagrant.configure("2") do |config| 
config.vm.network "private_network", ip: "192.168.50.4" 
end 
● Sync folders 
Vagrant.configure("2") do |config| 
config.vm.synced_folder "project/", "/var/www/project" 
end 
● Nfs is faster than native. Try latest vagrant with rsync
Vagrant provisioning 
● Shell 
● Puppet (model driven) 
● Chef (procedural) 
● Ansible 
● Salt 
● Docker 
● ...
Combining provisioners 
# Shell provision 
config.vm.provision "shell" do |s| 
s.path = "puphpet/shell/initial-setup.sh" 
s.args = "/vagrant/puphpet" 
end 
# Ansible provision 
config.vm.provision "ansible" do |ansible| 
ansible.playbook = "playbook.yml" 
end 
# Puppet provision 
config.vm.provision :puppet do |puppet| 
ssh_username = !data['ssh']['username'].nil? ? data['ssh']['username'] : "vagrant" 
puppet.facter = { 
"ssh_username" => "#{ssh_username}", 
"provisioner_type" => ENV['VAGRANT_DEFAULT_PROVIDER'], 
} 
puppet.manifests_path = "#{data['vm']['provision']['puppet']['manifests_path']}" 
puppet.manifest_file = "#{data['vm']['provision']['puppet']['manifest_file']}" 
end
puppet -> manifest.pp
- hosts: demovmbox ansible -> playbook.yml 
connection: local 
gather_facts: no 
vars: 
drupal_user: drupalcamplviv 
drupal_pass: ilovelviv 
installation_profile_name: presentation 
mysql_user: drupal 
mysql_pass: drupal 
mysql_db: drupal 
tasks: 
- name: Droping drupal database 
mysql_db: name={{ mysql_db }} state=absent 
- name: Creating drupal database 
mysql_db: name={{ mysql_db }} state=present 
- name: Installing drupal 
sudo: yes 
shell: "drush -y si {{ installation_profile_name }} --db-url=mysql://{{ 
mysql_user }}:{{ mysql_pass }}@127.0.0.1:/{{ mysql_db }} --account-name={{ 
drupal_user }} --account-pass={{ drupal_pass }}"
PuPHPet.com 
Demo
vagrant up demo 
Demo
PuPHPet.com
PuPHPet.com 
● All configs in puphpet/config.yaml 
● Uses puppet librarian (Puppetfile)
Extending configs 
● Use another puppet module 
− Add it to the Puppetfile 
− Modify manifest.pp 
● Add another provisioner 
− Add it to Vagrantfile 
− insert provisioner’s needed files to vagrant tree
Contributing to puphpet.com 
● Symfony app 
● Each config element is a separate bundle that 
provides UI and manifest.pp part 
● Remember about all OS (debian + centos)
PS. Drupal related tree/workflow
Usefull links 
● http://puphpet.drupal.ua/ 
● http://puphpet.com 
●● 
http://www.puppetcookbook.com/ 
● https://docs.vagrantup.com/v2/provisioning 
● http://docs.ansible.com/playbooks.html 
●● 
https://github.com/podarok/ansible-vagrant-examples 
●● 
https://www.drupal.org/project/vdd
Local development with Vagrant 
Questions? 
Andriy Podanenko 
Software Architect 
Propeople 
@podarok

More Related Content

PPTX
Using Ansible Dynamic Inventory with Amazon EC2
PDF
Ansible 202 - sysarmy
PPTX
Ansible - Crash course
PDF
Network Automation: Ansible 102
PDF
Ansible - Swiss Army Knife Orchestration
PDF
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
ODP
Perl dancer
PDF
Ansible roles done right
Using Ansible Dynamic Inventory with Amazon EC2
Ansible 202 - sysarmy
Ansible - Crash course
Network Automation: Ansible 102
Ansible - Swiss Army Knife Orchestration
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
Perl dancer
Ansible roles done right

What's hot (19)

PDF
Configuration Management in Ansible
PPTX
Best practices for ansible
PDF
Automation and Ansible
PDF
Ansible loves Python, Python Philadelphia meetup
PDF
Ansible leveraging 2.0
PDF
Hacking ansible
PDF
Vagrant for real
PPTX
Ansible presentation
PDF
V2 and beyond
PPTX
Ansible 101, Gennadiy Mykhailiuta
PDF
More tips n tricks
PDF
PDF
Ansible for beginners ...?
PPTX
Rapid dev env DevOps Warsaw July 2014
PPTX
Drupal cambs ansible for drupal april 2015
PDF
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
PPTX
Stack kicker devopsdays-london-2013
PPTX
Introduction to Ansible - (dev ops for people who hate devops)
Configuration Management in Ansible
Best practices for ansible
Automation and Ansible
Ansible loves Python, Python Philadelphia meetup
Ansible leveraging 2.0
Hacking ansible
Vagrant for real
Ansible presentation
V2 and beyond
Ansible 101, Gennadiy Mykhailiuta
More tips n tricks
Ansible for beginners ...?
Rapid dev env DevOps Warsaw July 2014
Drupal cambs ansible for drupal april 2015
Dev ninja -> vagrant + virtualbox + chef-solo + git + ec2
Stack kicker devopsdays-london-2013
Introduction to Ansible - (dev ops for people who hate devops)
Ad

Viewers also liked (18)

PPTX
Александр Даниленко - Panels как философия
PPTX
Алексей Горобец - Building Drupal Distributions. Why? When? and How?
PDF
Тарас Круц - Tips On Getting Everything You Can Out of Drupal Form API
PDF
Чеботарь Кирилл - Panels - пособие для начинающих
PPT
Алексей Колосов - Типичные ошибки разработчиков на Drupal (версии 5,6,7)
PDF
Караиванов Георгий - Drupal в проектах Электронного правительства
PPTX
Александр Шуменко - Varnish for authenticated users
PPTX
Александр Бондаренко - CommerceBox - Почему мы решили перевести нашу сборку н...
PDF
Денис Головняк - Продвинутый поиск с помощью Search API
PPTX
Виктор Левандовский - Why Drupal? Как продавать Родину с напильником.
PPTX
Иван Фесюк - ApacheSolr+DrupalCommerce связка для высоко нагруженых проектов
PPTX
Артем Сыльчук - Хранение полей в Drupal. От CCK к FieldableEntityStorageContr...
PPTX
Анатолий Поляков - Drupal.ajax framework from a to z
PPTX
Евгений Гарбузов - E-commerce. Создание интернет-магазина на базе Drupal Comm...
PDF
Тарас Цюпер - Мультиязычность в Drupal 8
PPTX
Березовский Андрей - Social Authentication
PPT
Сергей Мирошниченко - SEO-friendly data migration
PDF
Максим Ринг - Тестирование миграции и импорта
Александр Даниленко - Panels как философия
Алексей Горобец - Building Drupal Distributions. Why? When? and How?
Тарас Круц - Tips On Getting Everything You Can Out of Drupal Form API
Чеботарь Кирилл - Panels - пособие для начинающих
Алексей Колосов - Типичные ошибки разработчиков на Drupal (версии 5,6,7)
Караиванов Георгий - Drupal в проектах Электронного правительства
Александр Шуменко - Varnish for authenticated users
Александр Бондаренко - CommerceBox - Почему мы решили перевести нашу сборку н...
Денис Головняк - Продвинутый поиск с помощью Search API
Виктор Левандовский - Why Drupal? Как продавать Родину с напильником.
Иван Фесюк - ApacheSolr+DrupalCommerce связка для высоко нагруженых проектов
Артем Сыльчук - Хранение полей в Drupal. От CCK к FieldableEntityStorageContr...
Анатолий Поляков - Drupal.ajax framework from a to z
Евгений Гарбузов - E-commerce. Создание интернет-магазина на базе Drupal Comm...
Тарас Цюпер - Мультиязычность в Drupal 8
Березовский Андрей - Social Authentication
Сергей Мирошниченко - SEO-friendly data migration
Максим Ринг - Тестирование миграции и импорта
Ad

Similar to Андрей Поданенко - Start using Vagrant now! (20)

PDF
Create Development and Production Environments with Vagrant
ODP
Puppet and the HashiCorp Suite
PPTX
Environments line-up! Vagrant & Puppet 101
PPTX
Vagrant introduction for Developers
PDF
Taking the Friction Out of Ticket Investigation (Standardized Debugging Envir...
PDF
Quick & Easy Dev Environments with Vagrant
ODP
Automated reproducible images on openstack using vagrant and packer
KEY
Puppet for Java developers - JavaZone NO 2012
PDF
Minicurso de Vagrant
PDF
Puppet and the HashiStack
PDF
Vagrant for real
PDF
Vagrant for real (codemotion rome 2016)
PDF
Intro to vagrant
PDF
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
PDF
Create your very own Development Environment with Vagrant and Packer
PDF
vagrant-php
PDF
How I hack on puppet modules
PDF
Getting started with puppet and vagrant (1)
PDF
Tech Talk - Vagrant
PDF
Puppet @ Seat
Create Development and Production Environments with Vagrant
Puppet and the HashiCorp Suite
Environments line-up! Vagrant & Puppet 101
Vagrant introduction for Developers
Taking the Friction Out of Ticket Investigation (Standardized Debugging Envir...
Quick & Easy Dev Environments with Vagrant
Automated reproducible images on openstack using vagrant and packer
Puppet for Java developers - JavaZone NO 2012
Minicurso de Vagrant
Puppet and the HashiStack
Vagrant for real
Vagrant for real (codemotion rome 2016)
Intro to vagrant
Continuous Delivery with Maven, Puppet and Tomcat - ApacheCon NA 2013
Create your very own Development Environment with Vagrant and Packer
vagrant-php
How I hack on puppet modules
Getting started with puppet and vagrant (1)
Tech Talk - Vagrant
Puppet @ Seat

More from LEDC 2016 (20)

PPTX
A. Postnikov & P. Mahrinsky — Drupal Community — це ми
PDF
Слава Мережко — Практикум: "Як ростити розробників"
PDF
Генадій Колтун — Комунізм наступає: що будемо робити, коли машини навчаться п...
PDF
Олексій Калініченко — Configuration Management in Drupal8
PPTX
Олександр Лінивий — Multisite platform with continuous delivery process for m...
PPTX
Андрій Юн — Воркшоп "Docker use cases for developers"
PDF
Андрій Поданенко — Воркшоп "Розвертання CIBox"
PDF
Юрій Герасімов — Editorial experience in Drupal8
PPTX
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
PPTX
Тарас Кирилюк — Docker basics. How-to for Drupal developers
PDF
Тарас Круц — Open Social: brand new Drupal 8 distro for building social netwo...
PDF
Ігор Карпиленко — PHPStorm for drupal developer
PDF
Олександр Щедров — Build your application in seconds and optimize workflow as...
PPTX
Анатолій Поляков — Subdomains everywhere
PPTX
Артем Доценко — Deploy Plus. Better UI and more control for deploy module
PPTX
Сергій Бондаренко — Тестування Drupal сайтiв з допогою TqExtension
PPTX
Вадим Абрамчук — Big Drupal: Issues We Met
PDF
Юрій Герасимов — Delayed operations with queues
PPTX
Віталій Бобров — Web components, Polymer and Drupal
PPTX
Олександр Щедров та Альбіна Тюпа — Magic button. Can production releases be s...
A. Postnikov & P. Mahrinsky — Drupal Community — це ми
Слава Мережко — Практикум: "Як ростити розробників"
Генадій Колтун — Комунізм наступає: що будемо робити, коли машини навчаться п...
Олексій Калініченко — Configuration Management in Drupal8
Олександр Лінивий — Multisite platform with continuous delivery process for m...
Андрій Юн — Воркшоп "Docker use cases for developers"
Андрій Поданенко — Воркшоп "Розвертання CIBox"
Юрій Герасімов — Editorial experience in Drupal8
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
Тарас Кирилюк — Docker basics. How-to for Drupal developers
Тарас Круц — Open Social: brand new Drupal 8 distro for building social netwo...
Ігор Карпиленко — PHPStorm for drupal developer
Олександр Щедров — Build your application in seconds and optimize workflow as...
Анатолій Поляков — Subdomains everywhere
Артем Доценко — Deploy Plus. Better UI and more control for deploy module
Сергій Бондаренко — Тестування Drupal сайтiв з допогою TqExtension
Вадим Абрамчук — Big Drupal: Issues We Met
Юрій Герасимов — Delayed operations with queues
Віталій Бобров — Web components, Polymer and Drupal
Олександр Щедров та Альбіна Тюпа — Magic button. Can production releases be s...

Recently uploaded (20)

PDF
Paper PDF World Game (s) Great Redesign.pdf
PDF
Slides PDF The World Game (s) Eco Economic Epochs.pdf
PDF
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
PPT
Design_with_Watersergyerge45hrbgre4top (1).ppt
PPTX
international classification of diseases ICD-10 review PPT.pptx
PPTX
Introuction about ICD -10 and ICD-11 PPT.pptx
PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
PDF
Tenda Login Guide: Access Your Router in 5 Easy Steps
PPTX
Introuction about WHO-FIC in ICD-10.pptx
PDF
Decoding a Decade: 10 Years of Applied CTI Discipline
PDF
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
PPTX
Digital Literacy And Online Safety on internet
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
PDF
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
PPTX
presentation_pfe-universite-molay-seltan.pptx
PDF
RPKI Status Update, presented by Makito Lay at IDNOG 10
PDF
WebRTC in SignalWire - troubleshooting media negotiation
PDF
Unit-1 introduction to cyber security discuss about how to secure a system
PPTX
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
Paper PDF World Game (s) Great Redesign.pdf
Slides PDF The World Game (s) Eco Economic Epochs.pdf
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
Design_with_Watersergyerge45hrbgre4top (1).ppt
international classification of diseases ICD-10 review PPT.pptx
Introuction about ICD -10 and ICD-11 PPT.pptx
522797556-Unit-2-Temperature-measurement-1-1.pptx
Tenda Login Guide: Access Your Router in 5 Easy Steps
Introuction about WHO-FIC in ICD-10.pptx
Decoding a Decade: 10 Years of Applied CTI Discipline
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
Digital Literacy And Online Safety on internet
Job_Card_System_Styled_lorem_ipsum_.pptx
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
presentation_pfe-universite-molay-seltan.pptx
RPKI Status Update, presented by Makito Lay at IDNOG 10
WebRTC in SignalWire - troubleshooting media negotiation
Unit-1 introduction to cyber security discuss about how to secure a system
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
PptxGenJS_Demo_Chart_20250317130215833.pptx

Андрей Поданенко - Start using Vagrant now!

  • 1. Local development with Vagrant Andriy Podanenko Software Architect, DevOp Propeople @podarok
  • 2. Plan ● What is Vagrant? ● Provisioning, puppet, ansible ● Generating configs with puphpet.com ● How puphpet.com works internally
  • 3. What is Vagrant ● Layer on top ov virtual machine providers − Virtualbox − Vmware ● Command line tool ● Text file to control the settings ● Plenty of boxes available on internet
  • 4. Vagrant commands ● vagrant up ● vagrant ssh ● vagrant provision ● vagrant halt ● vagrant destroy ● vagrant reload --provision
  • 5. Vagrant up workflow -> vagrant up ● Obtaining vagrant box (vm image) - once ● Starting virtualbox (vm provider) ● Starting provisioners stack - first time and with --provision or when -> vagrant provision -> vm box up and running -> vagrant ssh
  • 6. Vagrant configuration ● Ruby syntax ● Box, ram, cpu Vagrant.configure("2") do |config| config.vm.box = 'ubuntu-1404' config.vm.box_url = 'http://.../ubuntu-1404-x64.box' config.vm.provider :virtualbox do |vb| vb.customize ["modifyvm", :id, "--memory", "2048"] vb.customize ["modifyvm", :id, "--cpus", "2"] end end
  • 7. Vagrant boxes ● https://vagrantcloud.com ● http://www.vagrantbox.es
  • 8. Vagrant configuration ● Network Vagrant.configure("2") do |config| config.vm.network "private_network", ip: "192.168.50.4" end ● Sync folders Vagrant.configure("2") do |config| config.vm.synced_folder "project/", "/var/www/project" end ● Nfs is faster than native. Try latest vagrant with rsync
  • 9. Vagrant provisioning ● Shell ● Puppet (model driven) ● Chef (procedural) ● Ansible ● Salt ● Docker ● ...
  • 10. Combining provisioners # Shell provision config.vm.provision "shell" do |s| s.path = "puphpet/shell/initial-setup.sh" s.args = "/vagrant/puphpet" end # Ansible provision config.vm.provision "ansible" do |ansible| ansible.playbook = "playbook.yml" end # Puppet provision config.vm.provision :puppet do |puppet| ssh_username = !data['ssh']['username'].nil? ? data['ssh']['username'] : "vagrant" puppet.facter = { "ssh_username" => "#{ssh_username}", "provisioner_type" => ENV['VAGRANT_DEFAULT_PROVIDER'], } puppet.manifests_path = "#{data['vm']['provision']['puppet']['manifests_path']}" puppet.manifest_file = "#{data['vm']['provision']['puppet']['manifest_file']}" end
  • 12. - hosts: demovmbox ansible -> playbook.yml connection: local gather_facts: no vars: drupal_user: drupalcamplviv drupal_pass: ilovelviv installation_profile_name: presentation mysql_user: drupal mysql_pass: drupal mysql_db: drupal tasks: - name: Droping drupal database mysql_db: name={{ mysql_db }} state=absent - name: Creating drupal database mysql_db: name={{ mysql_db }} state=present - name: Installing drupal sudo: yes shell: "drush -y si {{ installation_profile_name }} --db-url=mysql://{{ mysql_user }}:{{ mysql_pass }}@127.0.0.1:/{{ mysql_db }} --account-name={{ drupal_user }} --account-pass={{ drupal_pass }}"
  • 16. PuPHPet.com ● All configs in puphpet/config.yaml ● Uses puppet librarian (Puppetfile)
  • 17. Extending configs ● Use another puppet module − Add it to the Puppetfile − Modify manifest.pp ● Add another provisioner − Add it to Vagrantfile − insert provisioner’s needed files to vagrant tree
  • 18. Contributing to puphpet.com ● Symfony app ● Each config element is a separate bundle that provides UI and manifest.pp part ● Remember about all OS (debian + centos)
  • 19. PS. Drupal related tree/workflow
  • 20. Usefull links ● http://puphpet.drupal.ua/ ● http://puphpet.com ●● http://www.puppetcookbook.com/ ● https://docs.vagrantup.com/v2/provisioning ● http://docs.ansible.com/playbooks.html ●● https://github.com/podarok/ansible-vagrant-examples ●● https://www.drupal.org/project/vdd
  • 21. Local development with Vagrant Questions? Andriy Podanenko Software Architect Propeople @podarok