SlideShare a Scribd company logo
1 of 33
Development environments
made easy
Why?!
Gianluca - @GianArb – GianArb – gianarb.github.io
Vagrant
Command Line Tool
Gianluca - @GianArb – GianArb – gianarb.github.io
Box
vagrant box add <name> <url> <*provider>
Vagrant box list
Vagrant box remove <name> <*provider>
Gianluca - @GianArb – GianArb – gianarb.github.io
$. Vagrant box add precise32 <url>
$. Vagrant init precise32
$. Vagrant up
Goooo!!!
Gianluca - @GianArb – GianArb – gianarb.github.io
Providers
Virtualbox, VmWare“
Gianluca - @GianArb – GianArb – gianarb.github.io
Plugins
$. Vagrant plugin install <name>
$. Vagrant plugin uninstall <name>
$. Vagrant plugin list
Gianluca - @GianArb – GianArb – gianarb.github.io
Provisioning
How can i install my services?
Chef Solo - Chef Client
Shell – ansiable
Puppet apply – puppet Agent
Gianluca - @GianArb – GianArb – gianarb.github.io
That’s all?!
Where are my other commands?!
up – halt –suspend – provisioning
Reload – destroy - ssh -status
Gianluca - @GianArb – GianArb – gianarb.github.io
Sharing & Conf
This stuff is beautiful
Gianluca - @GianArb – GianArb – gianarb.github.io
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.box = "precise32"
config.vm.box_url = http://“./precise32.box
end
mode: ruby
Gianluca - @GianArb – GianArb – gianarb.github.io
Network
config.vm.forwardind_port(80, 8080)“
config.vm.network :private_network,
IP: ‚192.168.33.111‛ **
Config.VM.Network :public_network *
Gianluca - @GianArb – GianArb – gianarb.github.io
Network
**
Config.VM.Network :public_network,
:bridge => ‘en1:Wi-Fi (AirPort)’’
Gianluca - @GianArb – GianArb – gianarb.github.io
Provider
config.vm.provider :virtualbox do |vb|
vb.customize [
"modifyvm", :id,
"--cpus", 2,
"--memory", "1224"]
““..
end
Gianluca - @GianArb – GianArb – gianarb.github.io
Share Folders
config.vm.synced_folder "~/Sites", "/var/www‛
:owner=> "www-data", :group=> "www-data"
Nfs => true **
+
+
Gianluca - @GianArb – GianArb – gianarb.github.io
Share Folders
config.vm.synced_folder "~/Sites", "/var/www‛
:owner=> "www-data", :group=> "www-data"
Nfs => true **
+
+
Gianluca - @GianArb – GianArb – gianarb.github.io
My Skeleton
**
Gianluca - @GianArb – GianArb – gianarb.github.io
**
/cookbooks
This is my vendor
$. git submodule add
https://github.com/GianArb/opsworks-cookbooks
cookbooks
But““
Gianluca - @GianArb – GianArb – gianarb.github.io
Who is my Vendor?
http://github.com/opscode-cookbooks
Gianluca - @GianArb – GianArb – gianarb.github.io
Where is my Conf?!
config.vm.provision :chef_solo do |chef|
Chef.cookbooks_path=[‘my_cookbooks’,‘cookbooks’
chef.add_recipe ‚apt‛
chef.add_recipe ‚apache2‛
chef.Add_recipe ‚apache2::mod_rewrite‛
chef.add_recipe ‚php‛
chef.add_recipe ‚MYSQL‛
....
end
Gianluca - @GianArb – GianArb – gianarb.github.io
How can I configure
my conf? 0.o
config.vm.provision :chef_solo do |chef|
“.
chef.add_recipe ‚MYSQL‛
chef.json = {
:mysql=> {
:server_root_password => ’root’,
:server_debian_password => ’root’,
:server_Repl_password => ‘replica’,
:bind_address => ‘127.0.0.1’
}
}
end
Gianluca - @GianArb – GianArb – gianarb.github.io
config.vm.provision :chef_solo do |chef|
“.
chef.add_recipe ‚MYSQL‛
chef.json = {
:mysql=> {
:server_root_password => ’root’,
:server_debian_password => ’root’,
:server_Repl_password => ‘replica’,
:bind_address => ‘127.0.0.1’
}
}
end
Gianluca - @GianArb – GianArb – gianarb.github.io
Shell Provisioning
config.vm.provision :shell,
:inline => ‚echo ‘hello ciao!’‛
OR
config.vm.provision :shell,
:path=> ‚/path/to/script.sh’‛
Gianluca - @GianArb – GianArb – gianarb.github.io
What happen if
You can run this
Configuration of VM
Now?
Gianluca - @GianArb – GianArb – gianarb.github.io
Where is my
virtualhost?
Is the moment,
Now We are Beginning to
Create a custom
cookbook for this
application
Gianluca - @GianArb – GianArb – gianarb.github.io
App cookbooks
Gianluca - @GianArb – GianArb – gianarb.github.io
My_cookbooks/app/attributes/default.rb
My_cookbooks/app/recipes/virtualhost.rb
My_cookbooks/app/template/default/app.conf.erb
My_cookbooks/app/attributes/defau
lt.rb
Gianluca - @GianArb – GianArb – gianarb.github.io
In this file are setting all
nodes of recipe
configuration
default['app']['server_name'] = 'testapp.local'
default['app_test']['docroot'] = ‚/vagrant/src‚
My_cookbooks/app/recipes/virtualho
st.rb
Gianluca - @GianArb – GianArb – gianarb.github.io
#
# Cookbook Name:: app
# Recipe:: default
#
app_name = 'app'
app_config = node[app_name]
include_recipe "apt"
include_recipe "apache2"
include_recipe "apache2::mod_php5"
# Set up the Apache virtual host
web_app app_name do
server_name app_config['server_name']
docroot app_config['docroot']
template "#{app_name}.conf.erb"
log_dir node['apache']['log_dir']
end
…./template/default/app.conf.erb
Gianluca - @GianArb – GianArb – gianarb.github.io
<VirtualHost *:80>
ServerName <%= @params[:server_name] %>
ServerAlias <% @params[:server_aliases] && @params[:server_aliases].each do |a|
%><%= "#{a}" %> <% end %>
DocumentRoot <%= @params[:docroot] %>
<Directory <%= @params[:docroot] %>>
Options -Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Vagrant-omnibus
$. Vagrant plugin install vagrant-
omnibus
Gianluca - @GianArb – GianArb – gianarb.github.io
Vagrant.configure("2") do |config|
config.omnibus.chef_version = :latest
OR
config.omnibus.chef_version = ‚11.4.0‛
“
end
Bento
Create your custom .box
Gianluca - @GianArb – GianArb – gianarb.github.io
$. git clone git://github.com/opscode/bento.git
$. cd bento
$. bundle install
$. bundle exec veewee vbox list
$. bundle exec veewee vbox build ubuntu-12.04
Try now!
Gianluca - @GianArb – GianArb – gianarb.github.io
$. git clone
http://github.com/GianArb/pugMi2013-vagrant
$. cd pugMi2013-vagrant
$. git submodule init
$. git submodule update
$. cd cookbooks
$. git submodule init
$. git submodule update
Gianluca - @GianArb – GianArb – gianarb.github.io
http://vagrantup.com
http://github.com/opscode-cookbooks
http://www.vagrantbox.es
Irc.freenode.net/#vagrant
Irc.freenode.net/#chef
https://github.com/opscode/bento
https://github.com/schisamo/vagrant-omnibus
https://github.com/PUGTorino/application_zf
Gianluca
Arbezzano
me@gianarb.it

More Related Content

What's hot

REST with Her (and let Her take care of the REST)
REST with Her (and let Her take care of the REST)REST with Her (and let Her take care of the REST)
REST with Her (and let Her take care of the REST)Simon Courtois
 
Code reviews vs Pull requests
Code reviews vs Pull requestsCode reviews vs Pull requests
Code reviews vs Pull requestsTim Pettersen
 
Creating and Deploying Static Sites with Hugo
Creating and Deploying Static Sites with HugoCreating and Deploying Static Sites with Hugo
Creating and Deploying Static Sites with HugoBrian Hogan
 
Tracking large game assets with Git LFS
Tracking large game assets with Git LFSTracking large game assets with Git LFS
Tracking large game assets with Git LFSTim Pettersen
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionJoe Ferguson
 
Tracking huge files with Git LFS (GlueCon 2016)
Tracking huge files with Git LFS (GlueCon 2016)Tracking huge files with Git LFS (GlueCon 2016)
Tracking huge files with Git LFS (GlueCon 2016)Tim Pettersen
 
Master the New Core of Drupal 8 Now: with Symfony and Silex
Master the New Core of Drupal 8 Now: with Symfony and SilexMaster the New Core of Drupal 8 Now: with Symfony and Silex
Master the New Core of Drupal 8 Now: with Symfony and SilexRyan Weaver
 
DevOps Hackathon - Session 1: Vagrant
DevOps Hackathon - Session 1: VagrantDevOps Hackathon - Session 1: Vagrant
DevOps Hackathon - Session 1: VagrantAntons Kranga
 
Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...
Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...
Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...Lemi Orhan Ergin
 
DevOps hackathon Session 2: Basics of Chef
DevOps hackathon Session 2: Basics of ChefDevOps hackathon Session 2: Basics of Chef
DevOps hackathon Session 2: Basics of ChefAntons Kranga
 
Adding Source Control to Your Life
Adding Source Control to Your LifeAdding Source Control to Your Life
Adding Source Control to Your LifeMark Kelnar
 
Baremetal deployment scale
Baremetal deployment scaleBaremetal deployment scale
Baremetal deployment scalebaremetal
 
Build a bot workshop async primer - php[tek]
Build a bot workshop  async primer - php[tek]Build a bot workshop  async primer - php[tek]
Build a bot workshop async primer - php[tek]Adam Englander
 
Baremetal deployment
Baremetal deploymentBaremetal deployment
Baremetal deploymentbaremetal
 
NMX 2014 - Podcasting - How To Audio Podcast 100% from an iPad or iPhone
NMX 2014 - Podcasting - How To Audio Podcast 100% from an iPad or iPhoneNMX 2014 - Podcasting - How To Audio Podcast 100% from an iPad or iPhone
NMX 2014 - Podcasting - How To Audio Podcast 100% from an iPad or iPhoneNMX Events
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer ToolboxPablo Godel
 
Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017
Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017
Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017Lemi Orhan Ergin
 
Cookbook refactoring & abstracting logic to Ruby(gems)
Cookbook refactoring & abstracting logic to Ruby(gems)Cookbook refactoring & abstracting logic to Ruby(gems)
Cookbook refactoring & abstracting logic to Ruby(gems)Chef Software, Inc.
 

What's hot (20)

REST with Her (and let Her take care of the REST)
REST with Her (and let Her take care of the REST)REST with Her (and let Her take care of the REST)
REST with Her (and let Her take care of the REST)
 
Code reviews vs Pull requests
Code reviews vs Pull requestsCode reviews vs Pull requests
Code reviews vs Pull requests
 
Creating and Deploying Static Sites with Hugo
Creating and Deploying Static Sites with HugoCreating and Deploying Static Sites with Hugo
Creating and Deploying Static Sites with Hugo
 
Modern Perl Toolchain
Modern Perl ToolchainModern Perl Toolchain
Modern Perl Toolchain
 
Tracking large game assets with Git LFS
Tracking large game assets with Git LFSTracking large game assets with Git LFS
Tracking large game assets with Git LFS
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
 
Tracking huge files with Git LFS (GlueCon 2016)
Tracking huge files with Git LFS (GlueCon 2016)Tracking huge files with Git LFS (GlueCon 2016)
Tracking huge files with Git LFS (GlueCon 2016)
 
Master the New Core of Drupal 8 Now: with Symfony and Silex
Master the New Core of Drupal 8 Now: with Symfony and SilexMaster the New Core of Drupal 8 Now: with Symfony and Silex
Master the New Core of Drupal 8 Now: with Symfony and Silex
 
DevOps Hackathon - Session 1: Vagrant
DevOps Hackathon - Session 1: VagrantDevOps Hackathon - Session 1: Vagrant
DevOps Hackathon - Session 1: Vagrant
 
Etsy chef-workflow
Etsy chef-workflowEtsy chef-workflow
Etsy chef-workflow
 
Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...
Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...
Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...
 
DevOps hackathon Session 2: Basics of Chef
DevOps hackathon Session 2: Basics of ChefDevOps hackathon Session 2: Basics of Chef
DevOps hackathon Session 2: Basics of Chef
 
Adding Source Control to Your Life
Adding Source Control to Your LifeAdding Source Control to Your Life
Adding Source Control to Your Life
 
Baremetal deployment scale
Baremetal deployment scaleBaremetal deployment scale
Baremetal deployment scale
 
Build a bot workshop async primer - php[tek]
Build a bot workshop  async primer - php[tek]Build a bot workshop  async primer - php[tek]
Build a bot workshop async primer - php[tek]
 
Baremetal deployment
Baremetal deploymentBaremetal deployment
Baremetal deployment
 
NMX 2014 - Podcasting - How To Audio Podcast 100% from an iPad or iPhone
NMX 2014 - Podcasting - How To Audio Podcast 100% from an iPad or iPhoneNMX 2014 - Podcasting - How To Audio Podcast 100% from an iPad or iPhone
NMX 2014 - Podcasting - How To Audio Podcast 100% from an iPad or iPhone
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
 
Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017
Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017
Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017
 
Cookbook refactoring & abstracting logic to Ruby(gems)
Cookbook refactoring & abstracting logic to Ruby(gems)Cookbook refactoring & abstracting logic to Ruby(gems)
Cookbook refactoring & abstracting logic to Ruby(gems)
 

Viewers also liked

Software architectural pattern - MVC
Software architectural pattern - MVCSoftware architectural pattern - MVC
Software architectural pattern - MVCAbdul Malik Ikhsan
 
Codeigniter : The Introduction
Codeigniter  : The IntroductionCodeigniter  : The Introduction
Codeigniter : The IntroductionAbdul Malik Ikhsan
 
Pengenalan Konsep Open Source
Pengenalan Konsep Open SourcePengenalan Konsep Open Source
Pengenalan Konsep Open SourceThe Budiman
 
Pemanfaatan Aplikasi Open Source
Pemanfaatan Aplikasi Open SourcePemanfaatan Aplikasi Open Source
Pemanfaatan Aplikasi Open SourceThe Budiman
 
Queue System and Zend\Queue implementation
Queue System and Zend\Queue implementationQueue System and Zend\Queue implementation
Queue System and Zend\Queue implementationGianluca Arbezzano
 
DockerDublin Meetup - News about Docker 1.13
DockerDublin Meetup -  News about Docker 1.13DockerDublin Meetup -  News about Docker 1.13
DockerDublin Meetup - News about Docker 1.13Gianluca Arbezzano
 
Zend Framework 2 : Dependency Injection
Zend Framework 2 : Dependency InjectionZend Framework 2 : Dependency Injection
Zend Framework 2 : Dependency InjectionAbdul Malik Ikhsan
 
Time Series Database and Tick Stack
Time Series Database and Tick StackTime Series Database and Tick Stack
Time Series Database and Tick StackGianluca Arbezzano
 
Stime e preventivi in un contesto di sviluppo agile
Stime e preventivi in un contesto di sviluppo agileStime e preventivi in un contesto di sviluppo agile
Stime e preventivi in un contesto di sviluppo agileStefano Valle
 
NoSQL Containers get Rich
NoSQL Containers get RichNoSQL Containers get Rich
NoSQL Containers get RichStefano Valle
 
Moduli su Zend Framework 2: come sfruttarli
Moduli su Zend Framework 2: come sfruttarliModuli su Zend Framework 2: come sfruttarli
Moduli su Zend Framework 2: come sfruttarliStefano Valle
 
Asset management with Zend Framework 2
Asset management with Zend Framework 2Asset management with Zend Framework 2
Asset management with Zend Framework 2Stefano Valle
 
Instant ACLs with Zend Framework 2
Instant ACLs with Zend Framework 2Instant ACLs with Zend Framework 2
Instant ACLs with Zend Framework 2Stefano Valle
 
Introduzione alle metodologie di sviluppo agile
Introduzione alle metodologie di sviluppo agileIntroduzione alle metodologie di sviluppo agile
Introduzione alle metodologie di sviluppo agileStefano Valle
 
2015 Upload Campaigns Calendar - SlideShare
2015 Upload Campaigns Calendar - SlideShare2015 Upload Campaigns Calendar - SlideShare
2015 Upload Campaigns Calendar - SlideShareSlideShare
 
What to Upload to SlideShare
What to Upload to SlideShareWhat to Upload to SlideShare
What to Upload to SlideShareSlideShare
 
How to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksHow to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksSlideShare
 

Viewers also liked (20)

Silex, iniziamo
Silex, iniziamoSilex, iniziamo
Silex, iniziamo
 
Software architectural pattern - MVC
Software architectural pattern - MVCSoftware architectural pattern - MVC
Software architectural pattern - MVC
 
Codeigniter : The Introduction
Codeigniter  : The IntroductionCodeigniter  : The Introduction
Codeigniter : The Introduction
 
Pengenalan Konsep Open Source
Pengenalan Konsep Open SourcePengenalan Konsep Open Source
Pengenalan Konsep Open Source
 
Pemanfaatan Aplikasi Open Source
Pemanfaatan Aplikasi Open SourcePemanfaatan Aplikasi Open Source
Pemanfaatan Aplikasi Open Source
 
Queue System and Zend\Queue implementation
Queue System and Zend\Queue implementationQueue System and Zend\Queue implementation
Queue System and Zend\Queue implementation
 
DockerDublin Meetup - News about Docker 1.13
DockerDublin Meetup -  News about Docker 1.13DockerDublin Meetup -  News about Docker 1.13
DockerDublin Meetup - News about Docker 1.13
 
Zend Framework 2 : Dependency Injection
Zend Framework 2 : Dependency InjectionZend Framework 2 : Dependency Injection
Zend Framework 2 : Dependency Injection
 
Docker 1.12 and SwarmKit
Docker 1.12 and SwarmKitDocker 1.12 and SwarmKit
Docker 1.12 and SwarmKit
 
Time Series Database and Tick Stack
Time Series Database and Tick StackTime Series Database and Tick Stack
Time Series Database and Tick Stack
 
Stime e preventivi in un contesto di sviluppo agile
Stime e preventivi in un contesto di sviluppo agileStime e preventivi in un contesto di sviluppo agile
Stime e preventivi in un contesto di sviluppo agile
 
NoSQL Containers get Rich
NoSQL Containers get RichNoSQL Containers get Rich
NoSQL Containers get Rich
 
Moduli su Zend Framework 2: come sfruttarli
Moduli su Zend Framework 2: come sfruttarliModuli su Zend Framework 2: come sfruttarli
Moduli su Zend Framework 2: come sfruttarli
 
Introduzione a Git
Introduzione a GitIntroduzione a Git
Introduzione a Git
 
Asset management with Zend Framework 2
Asset management with Zend Framework 2Asset management with Zend Framework 2
Asset management with Zend Framework 2
 
Instant ACLs with Zend Framework 2
Instant ACLs with Zend Framework 2Instant ACLs with Zend Framework 2
Instant ACLs with Zend Framework 2
 
Introduzione alle metodologie di sviluppo agile
Introduzione alle metodologie di sviluppo agileIntroduzione alle metodologie di sviluppo agile
Introduzione alle metodologie di sviluppo agile
 
2015 Upload Campaigns Calendar - SlideShare
2015 Upload Campaigns Calendar - SlideShare2015 Upload Campaigns Calendar - SlideShare
2015 Upload Campaigns Calendar - SlideShare
 
What to Upload to SlideShare
What to Upload to SlideShareWhat to Upload to SlideShare
What to Upload to SlideShare
 
How to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksHow to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & Tricks
 

Similar to Vagrant - PugMI

Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for DevelopersAntons Kranga
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.catPablo Godel
 
Cloud Automation with Opscode Chef
Cloud Automation with Opscode ChefCloud Automation with Opscode Chef
Cloud Automation with Opscode ChefSri Ram
 
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine YardHow I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine YardSV Ruby on Rails Meetup
 
Mojolicious - A new hope
Mojolicious - A new hopeMojolicious - A new hope
Mojolicious - A new hopeMarcus Ramberg
 
Socket applications
Socket applicationsSocket applications
Socket applicationsJoão Moura
 
Chef Workshop: Setup Environment with Chef,Vagrant, and Berkshelf
Chef Workshop: Setup Environment with Chef,Vagrant, and BerkshelfChef Workshop: Setup Environment with Chef,Vagrant, and Berkshelf
Chef Workshop: Setup Environment with Chef,Vagrant, and BerkshelfJun Sakata
 
How to install squid proxy on server or how to install squid proxy on centos o
How to install squid proxy on server  or how to install squid proxy on centos oHow to install squid proxy on server  or how to install squid proxy on centos o
How to install squid proxy on server or how to install squid proxy on centos oProxiesforrent
 
What Makes a Good Chef Cookbook? (May 2014 Edition)
What Makes a Good Chef Cookbook? (May 2014 Edition)What Makes a Good Chef Cookbook? (May 2014 Edition)
What Makes a Good Chef Cookbook? (May 2014 Edition)Julian Dunn
 
Crafting Beautiful CLI Applications in Ruby
Crafting Beautiful CLI Applications in RubyCrafting Beautiful CLI Applications in Ruby
Crafting Beautiful CLI Applications in RubyNikhil Mungel
 
Antons Kranga Building Agile Infrastructures
Antons Kranga   Building Agile InfrastructuresAntons Kranga   Building Agile Infrastructures
Antons Kranga Building Agile InfrastructuresAntons Kranga
 
Continous Delivering a PHP application
Continous Delivering a PHP applicationContinous Delivering a PHP application
Continous Delivering a PHP applicationJavier López
 
How to develop modern web application framework
How to develop modern web application frameworkHow to develop modern web application framework
How to develop modern web application frameworktechmemo
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slidesharetomcopeland
 
20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdevFrank Rousseau
 

Similar to Vagrant - PugMI (20)

Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for Developers
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Cloud Automation with Opscode Chef
Cloud Automation with Opscode ChefCloud Automation with Opscode Chef
Cloud Automation with Opscode Chef
 
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine YardHow I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
 
Mojolicious - A new hope
Mojolicious - A new hopeMojolicious - A new hope
Mojolicious - A new hope
 
Socket applications
Socket applicationsSocket applications
Socket applications
 
Welcome to Jenkins
Welcome to JenkinsWelcome to Jenkins
Welcome to Jenkins
 
Chef Workshop: Setup Environment with Chef,Vagrant, and Berkshelf
Chef Workshop: Setup Environment with Chef,Vagrant, and BerkshelfChef Workshop: Setup Environment with Chef,Vagrant, and Berkshelf
Chef Workshop: Setup Environment with Chef,Vagrant, and Berkshelf
 
How to install squid proxy on server or how to install squid proxy on centos o
How to install squid proxy on server  or how to install squid proxy on centos oHow to install squid proxy on server  or how to install squid proxy on centos o
How to install squid proxy on server or how to install squid proxy on centos o
 
What Makes a Good Chef Cookbook? (May 2014 Edition)
What Makes a Good Chef Cookbook? (May 2014 Edition)What Makes a Good Chef Cookbook? (May 2014 Edition)
What Makes a Good Chef Cookbook? (May 2014 Edition)
 
Mojolicious lite
Mojolicious liteMojolicious lite
Mojolicious lite
 
Crafting Beautiful CLI Applications in Ruby
Crafting Beautiful CLI Applications in RubyCrafting Beautiful CLI Applications in Ruby
Crafting Beautiful CLI Applications in Ruby
 
Antons Kranga Building Agile Infrastructures
Antons Kranga   Building Agile InfrastructuresAntons Kranga   Building Agile Infrastructures
Antons Kranga Building Agile Infrastructures
 
infra-as-code
infra-as-codeinfra-as-code
infra-as-code
 
Continous Delivering a PHP application
Continous Delivering a PHP applicationContinous Delivering a PHP application
Continous Delivering a PHP application
 
How to develop modern web application framework
How to develop modern web application frameworkHow to develop modern web application framework
How to develop modern web application framework
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshare
 
Ubic
UbicUbic
Ubic
 
Ubic-public
Ubic-publicUbic-public
Ubic-public
 
20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev20130528 solution linux_frousseau_nopain_webdev
20130528 solution linux_frousseau_nopain_webdev
 

More from Gianluca Arbezzano

OSDC 2018 - Distributed monitoring
OSDC 2018 - Distributed monitoringOSDC 2018 - Distributed monitoring
OSDC 2018 - Distributed monitoringGianluca Arbezzano
 
Value of your metrics: goodbye monitoring, welcome observability
Value of your metrics: goodbye monitoring, welcome observabilityValue of your metrics: goodbye monitoring, welcome observability
Value of your metrics: goodbye monitoring, welcome observabilityGianluca Arbezzano
 
InfluxCloudi craft container orchestrator
InfluxCloudi craft container orchestratorInfluxCloudi craft container orchestrator
InfluxCloudi craft container orchestratorGianluca Arbezzano
 
Orbiter and how to extend Docker Swarm
Orbiter and how to extend Docker SwarmOrbiter and how to extend Docker Swarm
Orbiter and how to extend Docker SwarmGianluca Arbezzano
 
Overview and Opentracing in theory by Gianluca Arbezzano
Overview and Opentracing in theory by Gianluca ArbezzanoOverview and Opentracing in theory by Gianluca Arbezzano
Overview and Opentracing in theory by Gianluca ArbezzanoGianluca Arbezzano
 
Monitoring Pull vs Push, InfluxDB and Prometheus
Monitoring Pull vs Push, InfluxDB and PrometheusMonitoring Pull vs Push, InfluxDB and Prometheus
Monitoring Pull vs Push, InfluxDB and PrometheusGianluca Arbezzano
 
Open Tracing, to order and understand your mess. - ApiConf 2017
Open Tracing, to order and understand your mess. - ApiConf 2017Open Tracing, to order and understand your mess. - ApiConf 2017
Open Tracing, to order and understand your mess. - ApiConf 2017Gianluca Arbezzano
 
Security Tips to run Docker in Production
Security Tips to run Docker in ProductionSecurity Tips to run Docker in Production
Security Tips to run Docker in ProductionGianluca Arbezzano
 
Jenkins in the real world - DevOpsCon 2017
Jenkins in the real world - DevOpsCon 2017Jenkins in the real world - DevOpsCon 2017
Jenkins in the real world - DevOpsCon 2017Gianluca Arbezzano
 
Monitor your application and sleep
Monitor your application and sleepMonitor your application and sleep
Monitor your application and sleepGianluca Arbezzano
 
Tick Stack - Listen your infrastructure and please sleep
Tick Stack - Listen your infrastructure and please sleepTick Stack - Listen your infrastructure and please sleep
Tick Stack - Listen your infrastructure and please sleepGianluca Arbezzano
 
Docker Novosibirsk Meetup #3 - Docker in Production
Docker Novosibirsk Meetup #3 - Docker in ProductionDocker Novosibirsk Meetup #3 - Docker in Production
Docker Novosibirsk Meetup #3 - Docker in ProductionGianluca Arbezzano
 

More from Gianluca Arbezzano (13)

Kubernetes debug like a pro
Kubernetes debug like a proKubernetes debug like a pro
Kubernetes debug like a pro
 
OSDC 2018 - Distributed monitoring
OSDC 2018 - Distributed monitoringOSDC 2018 - Distributed monitoring
OSDC 2018 - Distributed monitoring
 
Value of your metrics: goodbye monitoring, welcome observability
Value of your metrics: goodbye monitoring, welcome observabilityValue of your metrics: goodbye monitoring, welcome observability
Value of your metrics: goodbye monitoring, welcome observability
 
InfluxCloudi craft container orchestrator
InfluxCloudi craft container orchestratorInfluxCloudi craft container orchestrator
InfluxCloudi craft container orchestrator
 
Orbiter and how to extend Docker Swarm
Orbiter and how to extend Docker SwarmOrbiter and how to extend Docker Swarm
Orbiter and how to extend Docker Swarm
 
Overview and Opentracing in theory by Gianluca Arbezzano
Overview and Opentracing in theory by Gianluca ArbezzanoOverview and Opentracing in theory by Gianluca Arbezzano
Overview and Opentracing in theory by Gianluca Arbezzano
 
Monitoring Pull vs Push, InfluxDB and Prometheus
Monitoring Pull vs Push, InfluxDB and PrometheusMonitoring Pull vs Push, InfluxDB and Prometheus
Monitoring Pull vs Push, InfluxDB and Prometheus
 
Open Tracing, to order and understand your mess. - ApiConf 2017
Open Tracing, to order and understand your mess. - ApiConf 2017Open Tracing, to order and understand your mess. - ApiConf 2017
Open Tracing, to order and understand your mess. - ApiConf 2017
 
Security Tips to run Docker in Production
Security Tips to run Docker in ProductionSecurity Tips to run Docker in Production
Security Tips to run Docker in Production
 
Jenkins in the real world - DevOpsCon 2017
Jenkins in the real world - DevOpsCon 2017Jenkins in the real world - DevOpsCon 2017
Jenkins in the real world - DevOpsCon 2017
 
Monitor your application and sleep
Monitor your application and sleepMonitor your application and sleep
Monitor your application and sleep
 
Tick Stack - Listen your infrastructure and please sleep
Tick Stack - Listen your infrastructure and please sleepTick Stack - Listen your infrastructure and please sleep
Tick Stack - Listen your infrastructure and please sleep
 
Docker Novosibirsk Meetup #3 - Docker in Production
Docker Novosibirsk Meetup #3 - Docker in ProductionDocker Novosibirsk Meetup #3 - Docker in Production
Docker Novosibirsk Meetup #3 - Docker in Production
 

Recently uploaded

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

Recently uploaded (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

Vagrant - PugMI

  • 2. Why?! Gianluca - @GianArb – GianArb – gianarb.github.io
  • 3. Vagrant Command Line Tool Gianluca - @GianArb – GianArb – gianarb.github.io
  • 4. Box vagrant box add <name> <url> <*provider> Vagrant box list Vagrant box remove <name> <*provider> Gianluca - @GianArb – GianArb – gianarb.github.io
  • 5. $. Vagrant box add precise32 <url> $. Vagrant init precise32 $. Vagrant up Goooo!!! Gianluca - @GianArb – GianArb – gianarb.github.io
  • 6. Providers Virtualbox, VmWare“ Gianluca - @GianArb – GianArb – gianarb.github.io
  • 7. Plugins $. Vagrant plugin install <name> $. Vagrant plugin uninstall <name> $. Vagrant plugin list Gianluca - @GianArb – GianArb – gianarb.github.io
  • 8. Provisioning How can i install my services? Chef Solo - Chef Client Shell – ansiable Puppet apply – puppet Agent Gianluca - @GianArb – GianArb – gianarb.github.io
  • 9. That’s all?! Where are my other commands?! up – halt –suspend – provisioning Reload – destroy - ssh -status Gianluca - @GianArb – GianArb – gianarb.github.io
  • 10. Sharing & Conf This stuff is beautiful Gianluca - @GianArb – GianArb – gianarb.github.io
  • 11. # -*- mode: ruby -*- # vi: set ft=ruby : Vagrant::Config.run do |config| config.vm.box = "precise32" config.vm.box_url = http://“./precise32.box end mode: ruby Gianluca - @GianArb – GianArb – gianarb.github.io
  • 12. Network config.vm.forwardind_port(80, 8080)“ config.vm.network :private_network, IP: ‚192.168.33.111‛ ** Config.VM.Network :public_network * Gianluca - @GianArb – GianArb – gianarb.github.io
  • 13. Network ** Config.VM.Network :public_network, :bridge => ‘en1:Wi-Fi (AirPort)’’ Gianluca - @GianArb – GianArb – gianarb.github.io
  • 14. Provider config.vm.provider :virtualbox do |vb| vb.customize [ "modifyvm", :id, "--cpus", 2, "--memory", "1224"] ““.. end Gianluca - @GianArb – GianArb – gianarb.github.io
  • 15. Share Folders config.vm.synced_folder "~/Sites", "/var/www‛ :owner=> "www-data", :group=> "www-data" Nfs => true ** + + Gianluca - @GianArb – GianArb – gianarb.github.io
  • 16. Share Folders config.vm.synced_folder "~/Sites", "/var/www‛ :owner=> "www-data", :group=> "www-data" Nfs => true ** + + Gianluca - @GianArb – GianArb – gianarb.github.io
  • 17. My Skeleton ** Gianluca - @GianArb – GianArb – gianarb.github.io
  • 18. ** /cookbooks This is my vendor $. git submodule add https://github.com/GianArb/opsworks-cookbooks cookbooks But““ Gianluca - @GianArb – GianArb – gianarb.github.io
  • 19. Who is my Vendor? http://github.com/opscode-cookbooks Gianluca - @GianArb – GianArb – gianarb.github.io
  • 20. Where is my Conf?! config.vm.provision :chef_solo do |chef| Chef.cookbooks_path=[‘my_cookbooks’,‘cookbooks’ chef.add_recipe ‚apt‛ chef.add_recipe ‚apache2‛ chef.Add_recipe ‚apache2::mod_rewrite‛ chef.add_recipe ‚php‛ chef.add_recipe ‚MYSQL‛ .... end Gianluca - @GianArb – GianArb – gianarb.github.io
  • 21. How can I configure my conf? 0.o config.vm.provision :chef_solo do |chef| “. chef.add_recipe ‚MYSQL‛ chef.json = { :mysql=> { :server_root_password => ’root’, :server_debian_password => ’root’, :server_Repl_password => ‘replica’, :bind_address => ‘127.0.0.1’ } } end Gianluca - @GianArb – GianArb – gianarb.github.io
  • 22. config.vm.provision :chef_solo do |chef| “. chef.add_recipe ‚MYSQL‛ chef.json = { :mysql=> { :server_root_password => ’root’, :server_debian_password => ’root’, :server_Repl_password => ‘replica’, :bind_address => ‘127.0.0.1’ } } end Gianluca - @GianArb – GianArb – gianarb.github.io
  • 23. Shell Provisioning config.vm.provision :shell, :inline => ‚echo ‘hello ciao!’‛ OR config.vm.provision :shell, :path=> ‚/path/to/script.sh’‛ Gianluca - @GianArb – GianArb – gianarb.github.io
  • 24. What happen if You can run this Configuration of VM Now? Gianluca - @GianArb – GianArb – gianarb.github.io
  • 25. Where is my virtualhost? Is the moment, Now We are Beginning to Create a custom cookbook for this application Gianluca - @GianArb – GianArb – gianarb.github.io
  • 26. App cookbooks Gianluca - @GianArb – GianArb – gianarb.github.io My_cookbooks/app/attributes/default.rb My_cookbooks/app/recipes/virtualhost.rb My_cookbooks/app/template/default/app.conf.erb
  • 27. My_cookbooks/app/attributes/defau lt.rb Gianluca - @GianArb – GianArb – gianarb.github.io In this file are setting all nodes of recipe configuration default['app']['server_name'] = 'testapp.local' default['app_test']['docroot'] = ‚/vagrant/src‚
  • 28. My_cookbooks/app/recipes/virtualho st.rb Gianluca - @GianArb – GianArb – gianarb.github.io # # Cookbook Name:: app # Recipe:: default # app_name = 'app' app_config = node[app_name] include_recipe "apt" include_recipe "apache2" include_recipe "apache2::mod_php5" # Set up the Apache virtual host web_app app_name do server_name app_config['server_name'] docroot app_config['docroot'] template "#{app_name}.conf.erb" log_dir node['apache']['log_dir'] end
  • 29. …./template/default/app.conf.erb Gianluca - @GianArb – GianArb – gianarb.github.io <VirtualHost *:80> ServerName <%= @params[:server_name] %> ServerAlias <% @params[:server_aliases] && @params[:server_aliases].each do |a| %><%= "#{a}" %> <% end %> DocumentRoot <%= @params[:docroot] %> <Directory <%= @params[:docroot] %>> Options -Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>
  • 30. Vagrant-omnibus $. Vagrant plugin install vagrant- omnibus Gianluca - @GianArb – GianArb – gianarb.github.io Vagrant.configure("2") do |config| config.omnibus.chef_version = :latest OR config.omnibus.chef_version = ‚11.4.0‛ “ end
  • 31. Bento Create your custom .box Gianluca - @GianArb – GianArb – gianarb.github.io $. git clone git://github.com/opscode/bento.git $. cd bento $. bundle install $. bundle exec veewee vbox list $. bundle exec veewee vbox build ubuntu-12.04
  • 32. Try now! Gianluca - @GianArb – GianArb – gianarb.github.io $. git clone http://github.com/GianArb/pugMi2013-vagrant $. cd pugMi2013-vagrant $. git submodule init $. git submodule update $. cd cookbooks $. git submodule init $. git submodule update
  • 33. Gianluca - @GianArb – GianArb – gianarb.github.io http://vagrantup.com http://github.com/opscode-cookbooks http://www.vagrantbox.es Irc.freenode.net/#vagrant Irc.freenode.net/#chef https://github.com/opscode/bento https://github.com/schisamo/vagrant-omnibus https://github.com/PUGTorino/application_zf Gianluca Arbezzano me@gianarb.it