Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Poise: Reusable Cookbook Patterns
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Noah Kantrowitz
April 16, 2014
Programming
740
1
Share
Poise: Reusable Cookbook Patterns
Noah Kantrowitz
April 16, 2014
More Decks by Noah Kantrowitz
See All by Noah Kantrowitz
The Long Hello World
coderanger
0
24
The Long Hello World (with notes)
coderanger
0
86
What Python Can Learn From Other Languages
coderanger
0
87
What Python Can Learn From Other Languages (with notes)
coderanger
0
210
Swiss Army Django: Small Footprint ETL (with notes) - DjangoCon US
coderanger
0
340
Swiss Army Django: Small Footprint ETL - DjangoCon US
coderanger
0
87
How to look at space: PyCon AU
coderanger
0
150
Swiss Army Django: Small Footprint ETL
coderanger
0
120
Swiss Army Django: Small Footprint ETL (with notes)
coderanger
0
100
Other Decks in Programming
See All in Programming
ソフトウェア設計の結合バランス #phperkaigi
kajitack
0
160
Don't Prompt Harder, Structure Better
kitasuke
0
790
t *testing.T は どこからやってくるの?
otakakot
1
800
ドメインイベントでビジネスロジックを解きほぐす #phpcon_odawara
kajitack
3
820
Kingdom of the Machine
yui_knk
2
1.1k
Spec Driven Development | AI Summit Vilnius
danielsogl
PRO
1
120
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
150
PHPer、Cloudflare に引っ越す
suguruooki
1
110
エラー処理の温故知新 / history of error handling technic
ryotanakaya
7
1.7k
【26新卒研修資料】TDD実装演習
dip_tech
PRO
0
110
「話せることがない」を乗り越える 〜日常業務から登壇テーマをつくる思考法〜
shoheimitani
4
890
10 Tips of AWS ~Gen AI on AWS~
licux
5
480
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.2k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
10k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
180
So, you think you're a good person
axbom
PRO
2
2k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
680
Ethics towards AI in product and experience design
skipperchong
2
260
Done Done
chrislema
186
16k
[SF Ruby Conf 2025] Rails X
palkan
2
980
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
110
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
280
Color Theory Basics | Prateek | Gurzu
gurzu
0
300
Transcript
Cookbook Patterns Poise Noah Kantrowitz
Me •PSF + PyCon •Balanced •Chef •Making things
•What? •Why? •How?
None
None
None
cook·book A description of a piece of infrastructure
Role Cookbook Recipe Resource
None
leak·y ab·strac·tion Incomplete hiding of internal details
None
•Fork (and patch) •Wrapper •Rewind
Inheritance
None
10x
Poise
•Helpers •DSL extensions •Patterns
None
•jenkins •jenkins_job •jenkins_credential •jenkins_plugin
•ci_job •ci_pipeline •name_ci_pipeline
Using Poise
class Chef class ... ... end end
Resource::Foo < Resource Provider::Foo < Provider
•Foo => foo •FooBar => foo_bar •FOO => f_o_o
class ... include Poise ... end
action(:one, :two) attribute(:name, kind_of: String)
attribute(:opts, option_collector: true ) opts do foo 'bar' end
attribute(:path, default: lazy { ... })
attribute(:config, template: true) attribute('', template: true)
foo ... do source 'cfg.erb' end foo ... do content
'x=1' end
file ... do content nr.content end
class Provider... def action_one ... end end
notifying_block do ... end
include_recipe ...
Putting It Together
class Res::Foo < Res include Poise action(:one) attribute(:pkg) attribute(:ver) end
def action_one notifying_block do install_pkg write_config end end
def install_pkg package nr.pkg do version nr.ver end end
def install_pkg r = super r.package_name( 'my-thing') r end
Next Steps
Subresources
Cookbook Tiers
•poise-proxy •poise-appenv •poise-service?
•attribute(node: ...) •group do ... end •after(:one)
None
Thank You