Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

Deploying in Unforgiving Environments (Control Your Dependencies) (the network is a dependency)

Slide 3

Slide 3 text

/(robbkidd)/ twitter.com/$1 github.com/$1

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

History

Slide 6

Slide 6 text

Configker

Slide 7

Slide 7 text

Chef-Server

Slide 8

Slide 8 text

Chef-Solo

Slide 9

Slide 9 text

Patterns for Getting Stuff on Your Servers

Slide 10

Slide 10 text

remote_file

Slide 11

Slide 11 text

The Essential remote_file remote_file "/opt/sauce/sauce_#{node[:sauce][:version]}.tgz" do source "#{node[:sauce][:url]}/awesome_sauce_#{node[:sauce][:version]}.tgz" end

Slide 12

Slide 12 text

Better: Give It a Checksum remote_file "/opt/sauce/sauce_#{node[:sauce][:version]}.tgz" do source "#{node[:sauce][:url]}/awesome_sauce_#{node[:sauce][:version]}.tgz" * checksum node[:sauce][:checksum] end

Slide 13

Slide 13 text

Ever Better: Put It in the Chef Cache # v-------------------------------v * remote_file "#{Chef::Config[:file_cache_path]}/sauce_#{node[:sauce][:version]}.tgz" do source "#{node[:sauce][:url]}/awesome_sauce_#{node[:sauce][:version]}.tgz" checksum node[:sauce][:checksum] end

Slide 14

Slide 14 text

packaging

Slide 15

Slide 15 text

fpm

Slide 16

Slide 16 text

Example Packaging Step fpm -s dir \ -t deb \ --name awesome_sauce \ --version "$(shell git describe --always --tag)" \ --before-install ./etc/preinst.sh \ --deb-upstart ./etc/saucy \ --config-files /etc/saucy.yml \ ./bin/saucy=/usr/bin/ \ saucy.yml.sample=/etc/saucy/

Slide 17

Slide 17 text

shelling out

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

RVM 4 custom RVM install ahead of chef-rvm 4 install RVM via tarball according to the offline steps 4 rvm mount ruby-version.tgz 4 carry on with our uses of chev-rvm 4 rvm-shell mostly

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

python's default.rb include_recipe "python::#{node['python']['install_method']}" include_recipe "python::pip" include_recipe "python::virtualenv"

Slide 23

Slide 23 text

python_shim.rb %w(python-pip python-virtualenv).each do |pkg| package pkg do action :install end end link "/usr/local/bin/pip" do to "/usr/bin/pip" end directory "/root/.pip/" file "/root/.pip/pip.conf" do content "[global]\ntimeout = 1\n" end

Slide 24

Slide 24 text

Getting Stuff on Your Servers (Review) 4 remote_file 4 packages 4 shelling out :(

Slide 25

Slide 25 text

A Tale of Three Caches

Slide 26

Slide 26 text

Library Cache

Slide 27

Slide 27 text

bundle package (for ruby peeps)

Slide 28

Slide 28 text

Package Cache

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

apt-cacher-ng

Slide 31

Slide 31 text

Chef Cache

Slide 32

Slide 32 text

vagrant-cachier

Slide 33

Slide 33 text

monkeypatch

Slide 34

Slide 34 text

class ::Chef class Provider class RemoteFile class Content < Chef::FileContentManagement::ContentBase private def current_resource_matches_target_checksum? ::Chef::Log.info("Airgapped - skipping content checksum for #{@new_resource}") true end end end end end

Slide 35

Slide 35 text

Mo' Better? (things I haven't got working yet)

Slide 36

Slide 36 text

chef-client --local-mode

Slide 37

Slide 37 text

Shim Cookbook AntiPattern?

Slide 38

Slide 38 text

no 3rd party cookbooks?

Slide 39

Slide 39 text

omnibus packages?

Slide 40

Slide 40 text

containers?

Slide 41

Slide 41 text

Shoulders of Giants Mark Olson - Lookingglass Eric Sproul - Circonus

Slide 42

Slide 42 text

Review 4 history 4 recipe patterns 4 caching tricks 4 future possibilities

Slide 43

Slide 43 text

Payoff 4 works without access to network resources 4 chef convergence is faster! 4 chef convergence is predictable!

Slide 44

Slide 44 text

4 Mind the Gap photo by Clicsouris 4 Vagrant - Mitchell Hashimoto/Hashicorp 4 vagrant-cachier - Fabio Rehm 4 fpm - Jordan Sissell 4 knife-solo - Mat Schaffer