Slide 1

Slide 1 text

freistil.it Use datacenter tools to make your dev life easier Jochen Lillich

Slide 2

Slide 2 text

About me

Slide 3

Slide 3 text

Jochen Lillich @geewiz * 1970 Linux Sysadmin & Trainer IT Manager at WEB.DE, 1&1 Founder & CTO at freistil IT

Slide 4

Slide 4 text

freistil IT http://freistil.it @freistil “Ops for Devs” DrupalCONCEPT: Drupal IaaS

Slide 5

Slide 5 text

Challenge... Local development environments Manual configuration effort Mismatched software versions Long onboarding times

Slide 6

Slide 6 text

...accepted! Minimize setup time Make Development = Production Reproduce setup consistently on demand

Slide 7

Slide 7 text

Vagrant

Slide 8

Slide 8 text

“Vagrant uses Oracle’s VirtualBox to build configurable, lightweight, and portable virtual machines dynamically.” http://vagrantup.com

Slide 9

Slide 9 text

$ gem install vagrant $ vagrant box add precise64 http:// files.vagrantup.com/precise64.box $ cd ~/myvm $ vagrant init precise64 $ vagrant up $ vagrant ssh Instant VM

Slide 10

Slide 10 text

Pre-installed OS Available from http://files.vagrantup.com Box

Slide 11

Slide 11 text

Box – Management $ vagrant box -h $ vagrant package -h

Slide 12

Slide 12 text

Box – DIY VeeWee by Patrick Dubois https://github.com/jedi4ever/veewee

Slide 13

Slide 13 text

Vagrantfile Ruby DSL for VM configuration Can be used for many VMs

Slide 14

Slide 14 text

Vagrant::Config.run do |config| config.vm.box = "precise64" config.vm.boot_mode = :gui config.vm.forward_port 80, 8080 end Vagrantfile

Slide 15

Slide 15 text

“Well, I’ve been doing that for ages with snapshots/ images/other...”

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

“No matter how complex the realities of your business, Chef makes it easy to deploy servers and scale applications throughout your entire infrastructure.” http://www.opscode.com/chef/

Slide 18

Slide 18 text

Ruby DSL for system administration tasks Makes only necessary changes (Idempotence) CM with Chef

Slide 19

Slide 19 text

Infrastructure as Code Cookbooks Recipes Resources Providers Nodes Attributes Roles

Slide 20

Slide 20 text

Resources Package Service File, Directory Template Command, Script Cron Git ...

Slide 21

Slide 21 text

Example package ”apache2” do action :install end service ”apache2” do action [:enable, :start] end

Slide 22

Slide 22 text

Example (cont.) template ”/etc/apache2/apache2.conf” do source ”apache2.conf.erb” owner ”root” group ”root” mode 0644 notifies ”reload”, ”service[apache2]” end

Slide 23

Slide 23 text

Community sites http://wiki.opscode.com http://community.opscode.com http://github.com/opscode-cookbooks

Slide 24

Slide 24 text

+

Slide 25

Slide 25 text

Installation $ gem install librarian $ cd ~/myvm $ librarian-chef init $ $EDITOR Cheffile $ librarian-chef install

Slide 26

Slide 26 text

Cheffile site ”http://community.opscode.com/api/v1” cookbook ’apache2’ cookbook ’php’ cookbook ’mysql’

Slide 27

Slide 27 text

roles/drupal.rb name "drupal" description "Drupal dev VM" run_list( "recipe[apache2]", "recipe[apache2::mod_expires]", "recipe[apache2::mod_rewrite]", "recipe[apache2::mod_php5]", "recipe[php]", "recipe[php::module_mysql]", "recipe[mysql::client]", "recipe[mysql::server]" )

Slide 28

Slide 28 text

Vagrantfile config.vm.provision :chef_solo do |chef| chef.cookbooks_path = ”cookbooks” chef.roles_path = ”roles” chef.add_role ”drupal-dev” end

Slide 29

Slide 29 text

Kitchen magic $ vagrant provision

Slide 30

Slide 30 text

Now do some awesome stuff!

Slide 31

Slide 31 text

And finally... $ vagrant destroy

Slide 32

Slide 32 text

Tips Keep all building blocks local: Cache packages Store your own base boxes Use a central cookbook repository

Slide 33

Slide 33 text

Conclusion Combining Vagrant and Chef gives us: Dedicated, consistent, disposable dev setups Efficient onboarding of new devs

Slide 34

Slide 34 text

Thank you! Please rate my session: http://bit.ly/dc12chef