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
Noah Kantrowitz
April 16, 2014
Programming
1
720
Poise: Reusable Cookbook Patterns
Noah Kantrowitz
April 16, 2014
Tweet
Share
More Decks by Noah Kantrowitz
See All by Noah Kantrowitz
What Python Can Learn From Other Languages
coderanger
0
66
What Python Can Learn From Other Languages (with notes)
coderanger
0
170
Swiss Army Django: Small Footprint ETL (with notes) - DjangoCon US
coderanger
0
240
Swiss Army Django: Small Footprint ETL - DjangoCon US
coderanger
0
65
How to look at space: PyCon AU
coderanger
0
110
Swiss Army Django: Small Footprint ETL
coderanger
0
94
Swiss Army Django: Small Footprint ETL (with notes)
coderanger
0
86
Minimum Viable Kubernetes
coderanger
0
41
Minimum Viable Kubernetes (with notes)
coderanger
0
460
Other Decks in Programming
See All in Programming
「待たせ上手」なスケルトンスクリーン、 そのUXの裏側
teamlab
PRO
0
570
AI時代のUIはどこへ行く?
yusukebe
18
9.1k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
420
時間軸から考えるTerraformを使う理由と留意点
fufuhu
16
4.8k
Compose Multiplatform × AI で作る、次世代アプリ開発支援ツールの設計と実装
thagikura
0
170
AIを活用し、今後に備えるための技術知識 / Basic Knowledge to Utilize AI
kishida
22
5.9k
MCPとデザインシステムに立脚したデザインと実装の融合
yukukotani
4
1.5k
パッケージ設計の黒魔術/Kyoto.go#63
lufia
3
440
JSONataを使ってみよう Step Functionsが楽しくなる実践テクニック #devio2025
dafujii
1
640
Namespace and Its Future
tagomoris
6
710
意外と簡単!?フロントエンドでパスキー認証を実現する WebAuthn
teamlab
PRO
2
780
ファインディ株式会社におけるMCP活用とサービス開発
starfish719
0
2.1k
Featured
See All Featured
Building Applications with DynamoDB
mza
96
6.6k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
930
The Straight Up "How To Draw Better" Workshop
denniskardys
236
140k
Site-Speed That Sticks
csswizardry
10
820
jQuery: Nuts, Bolts and Bling
dougneiner
64
7.9k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
30
9.7k
A better future with KSS
kneath
239
17k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.9k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Rails Girls Zürich Keynote
gr2m
95
14k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
530
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
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