Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Poise: Reusable Cookbook Patterns
Search
Noah Kantrowitz
April 16, 2014
Programming
770
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Poise: Reusable Cookbook Patterns
Noah Kantrowitz
April 16, 2014
More Decks by Noah Kantrowitz
See All by Noah Kantrowitz
I Am Bad At Things
coderanger
0
28
I Am Bad At Things (with notes)
coderanger
0
58
The Long Hello World
coderanger
0
45
The Long Hello World (with notes)
coderanger
0
170
What Python Can Learn From Other Languages
coderanger
0
110
What Python Can Learn From Other Languages (with notes)
coderanger
0
270
Swiss Army Django: Small Footprint ETL (with notes) - DjangoCon US
coderanger
0
410
Swiss Army Django: Small Footprint ETL - DjangoCon US
coderanger
0
110
How to look at space: PyCon AU
coderanger
0
170
Other Decks in Programming
See All in Programming
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
180
Streamlitで実現する自然言語データアプリ開発
ayumu_yamaguchi
1
330
選挙速報を多くのユーザーへ 届ける Live Activities 設計
hamayokokuririn
0
190
巨大モノリシックアプリ モダン化大作戦
ktcryomm
1
1.2k
Java 27新機能 / Java 27 new features
kishida
2
190
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
4.4k
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
280
thread_parallel_with_free-threaded_Python_and_NumPy.pdf
riku_sakamoto
0
370
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
270
スマートフォンでモールス信号を送受信する 〜スマートフォンのLEDとカメラで作る光通信の設計と実装〜
atsuki_seo
0
210
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
730
AGENTS.md Is Not Enough:Build Skills, Don't Download Them
lx_t
0
130
Featured
See All Featured
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
510
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
66k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.8k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
330
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Tell your own story through comics
letsgokoyo
1
1.1k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
420
My Coaching Mixtape
mlcsv
0
330
Why Our Code Smells
bkeepers
PRO
340
58k
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