Ghent Belgium
Chef Reusability!Config Management Camp!Ghent, Belgium!February 2015
View Slide
Sean OMeara![email protected]!@someara
whoami
Part 1
Things that are true
New Chef usersexpect communitycookbooks tojust work
Especially the Chefmaintained cookbooks
This is not the currentstate of things
This leads to sadness
We must repair it
People copy patterns
The status quo cannotbe allowed to continue
Common pain pointshttps://www.flickr.com/photos/kwl/4595324641
Platform and versionsupport
Weak scoping
No standard interface
Compilation phase work
Needing chef-rewind
Attributes and precedence
Pattern proliferation
The path out of the darknesshttps://www.flickr.com/photos/[email protected]/15864687537
Change how cookbooksare written
systemsbeliefs! behaviors
Standardize interfaces
Eliminate the pain points
Focus on resources
Make it super easy!to write resources
Ship resources for ALLTHE THINGS
Copy better patterns
Make it fuckingdelightful
Part 2
Simple design patternshttps://www.flickr.com/photos/pollock/4172865252
You just separated datafrom code
You also just built aninterface
Complex design patternshttps://www.flickr.com/photos/alanosaur/6417040565
This is where thingsget weird
amazondebian-6debian-7ubuntu-10.04ubuntu-12.04ubuntu-14.04centos-5centos-6centos-7freebsd-9freebsd-10
Debconf!Docker!LaunchD!Runit!SMF!Simple!SystemD!Sysvinit!Upstart!Windows Services
There is a large amountof variation betweensoftware versions
There is an insane amountvariation across platforms
These differences needto be handledsomewhere
Early techniques dideverything in the recipe
dataresourcepattern
Later techniquesfocused on isolation
Resource patternisolation
privaterecipes byconvention
Resource data isolation
We now have decisionlogic in our interface
Default values oftenneed to be computed
Doing this in theinterface leads tosorrow
We need a better way
Consumption Patternshttps://www.flickr.com/photos/ektogamat/2578779839
Why resources are besthttps://www.flickr.com/photos/cross_stitch_ninja/4932950637
node attributesrolesenvironmentsdatabagsare nice to haves
They drive data aboutresources
Resources arefundamental
Resources are stronglyscoped
Resources have astandardized interface
Resources have types,names, and parameters
Type
Name
Parameters
Resources haveidentities
Resource can see eachother
Promise totalk
Promise to listen
Resource behave thesame across platforms
Resource can havemultiple providers
Writing simple resources
yum
Writing complex resources
mysqlhttpd
fin