Page 1
Chef Reusability!Config Management Camp!
Ghent, Belgium!February 2015
Page 2
Sean [email protected] !
@someara
Page 5
Things that are true
Page 6
New Chef users expect community cookbooks to just work
Page 7
Especially the Chef maintained cookbooks
Page 8
This is not the current state of things
Page 9
This leads to sadness
Page 10
We must repair it
Page 11
People copy patterns
Page 12
The status quo cannot be allowed to continue
Page 13
Common pain points
https://www.flickr.com/photos/kwl/4595324641
Page 14
Platform and version support
Page 16
No standard interface
Page 17
Compilation phase work
Page 18
Needing chef-rewind
Page 19
Attributes and precedence
Page 20
Pattern proliferation
Page 21
The path out of the darkness
https://www.flickr.com/photos/71267357@N06/15864687537
Page 22
Change how cookbooks are written
Page 23
systems
beliefs! behaviors
Page 24
Standardize interfaces
Page 25
Eliminate the pain points
Page 26
Focus on resources
Page 27
Make it super easy!to write resources
Page 28
Ship resources for ALL THE THINGS
Page 29
Copy better patterns
Page 30
Make it fucking delightful
Page 33
Simple design patterns
https://www.flickr.com/photos/pollock/4172865252
Page 36
You just separated data from code
Page 37
You also just built an interface
Page 38
Complex design patterns
https://www.flickr.com/photos/alanosaur/6417040565
Page 41
This is where things get weird
Page 42
amazon debian-6 debian-7 ubuntu-10.04 ubuntu-12.04 ubuntu-14.04 centos-5 centos-6 centos-7 freebsd-9 freebsd-10
Page 43
Debconf!Docker!LaunchD!Runit!SMF!Simple!SystemD!Sysvinit!Upstart!Windows Services
Page 44
There is a large amount of variation between software versions
Page 45
There is an insane amount variation across platforms
Page 46
These differences need to be handled somewhere
Page 47
Early techniques did everything in the recipe
Page 48
data
resource pattern
Page 49
Later techniques focused on isolation
Page 50
Resource pattern isolation
Page 52
private recipes by convention
Page 53
Resource data isolation
Page 56
We now have decision logic in our interface
Page 57
Default values often need to be computed
Page 58
Doing this in the interface leads to sorrow
Page 60
We need a better way
Page 61
Consumption Patterns
https://www.flickr.com/photos/ektogamat/2578779839
Page 66
Why resources are best
https://www.flickr.com/photos/cross_stitch_ninja/4932950637
Page 67
node attributes roles environments databags are nice to haves
Page 68
They drive data about resources
Page 69
Resources are fundamental
Page 70
Resources are strongly scoped
Page 71
Resources have a standardized interface
Page 72
Resources have types, names, and parameters
Page 76
Resources have identities
Page 78
Resource can see each other
Page 80
Promise to listen
Page 81
Resource behave the same across platforms
Page 85
Resource can have multiple providers
Page 87
Writing simple resources
Page 89
</switches github>
Page 90
Writing complex resources
Page 92
</switches github>