Slide 1

Slide 1 text

Vagrant /dev/var/2, Toulon, 21/11/2013 by @FedirFR

Slide 2

Slide 2 text

Oxford English Dictionary Vagrant ● “a person without a settled home or regular work who wanders from place to place and lives by begging” ● archaic a wanderer

Slide 3

Slide 3 text

Un vagabond => Mobilité, minimalisme, poyvalence

Slide 4

Slide 4 text

Géré des environnements virtuels

Slide 5

Slide 5 text

Socle de Virtualbox

Slide 6

Slide 6 text

Mais à la manière /dev/ ++

Slide 7

Slide 7 text

Scripting Scénarios Boxes

Slide 8

Slide 8 text

L'ADN de votre projet

Slide 9

Slide 9 text

Vagrantfile

Slide 10

Slide 10 text

Vagrantfile = Un grain, qui devient une arbre

Slide 11

Slide 11 text

Vagrantfile = Un atome, qui devient l’Univers

Slide 12

Slide 12 text

Vagrant.configure("2") do |config| config.vm.box = "quantal" config.vm.box_url = "https://github.com/downloads/roderik/VagrantQuantal64Box/quantal64.box" config.ssh.forward_agent = true config.vm.network :private_network, ip: "192.168.23.4" config.vm.provision :chef_solo do |chef| chef.cookbooks_path = [ "cookbooks", "site-cookbooks" ] chef.log_level = :debug chef.add_recipe "typo3-neos" end config.vm.provider "virtualbox" do |v| v.name = "TYPO3 Neos" v.customize ["modifyvm", :id, "--memory", "2048"] end end

Slide 13

Slide 13 text

salt puppet chef Gestionnaires de configuration

Slide 14

Slide 14 text

Quelques recettes du chef

Slide 15

Slide 15 text

Installation des paquets include_recipe 'apache2' ['rewrite', 'deflate', 'php5', 'headers', 'expires', 'status', 'negotiation', 'setenvif'].each do |mod| include_recipe "apache2::mod_#{mod}" end include_recipe "php::package" ['apc', 'curl', 'gd', 'mysql', 'sqlite3'].each do |mod| include_recipe "php::module_#{mod}" end include_recipe 'mysql::server' include_recipe 'git'

Slide 16

Slide 16 text

cookbook_file "/etc/apache2/sites-available/typo3.neos" do source "typo3.neos" mode 0755 end apache_site "000-default" do enable false end apache_site "typo3.neos" do enable true end execute "reload apache" do command "/etc/init.d/apache2 reload" end Configuration de serveur

Slide 17

Slide 17 text

Installation de CMS execute "clone typo3.neos base" do command "git clone git://git.typo3.org/Neos/Distributions/Base.git /var/www/typo3.neos" creates "/var/www/typo3.neos/" end execute "get composer" do command "curl -s https://getcomposer.org/installer | php" cwd "/var/www/typo3.neos" end execute "install TYPO3 Neos" do command "php composer.phar install --dev" cwd "/var/www/typo3.neos" end execute "fixing permissions" do command "Packages/Framework/TYPO3.Flow/Scripts/setfilepermissions.sh vagrant vagrant www-data" cwd "/var/www/typo3.neos/" end

Slide 18

Slide 18 text

Essentiel de runtime

Slide 19

Slide 19 text

init up suspend halt destroy Commandes de base ssh reload

Slide 20

Slide 20 text

Essayez du nouveau

Slide 21

Slide 21 text

Beaucoup de boîtes déjà prêtes TYPO3 Neos https://github.com/fedir/vagrant-typo3neos Django https://github.com/torchbox/vagrant-django-template RoR https://github.com/rails/rails-dev-box Symfony https://github.com/seiffert/symfony-vagrant/tree/2.2 Erlang https://github.com/rpt/vagrant-erlang

Slide 22

Slide 22 text

Up and running gem install vagrant vagrant clone https://github.com/user/vagrant-project vagrant up

Slide 23

Slide 23 text

Ressources ● https://github.com/fedir/vagrant-typo3neos ● http://www.vagrantbox.es/ ● http://ajohnstone.com/achives/vagrant-automating-php-installation-with-bashslack-for- continuous-deployment/ ● http://docs.vagrantup.com/v2/ ● http://www.slideshare.net/khokhlova1991/vagrant-19053161 ● http://habrahabr.ru/post/140714/ ● https://github.com/WinRb/vagrant-windows

Slide 24

Slide 24 text

Let’s box & cook @FedirFr github.com/fedir