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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
20
The Long Hello World (with notes)
coderanger
0
77
What Python Can Learn From Other Languages
coderanger
0
84
What Python Can Learn From Other Languages (with notes)
coderanger
0
210
Swiss Army Django: Small Footprint ETL (with notes) - DjangoCon US
coderanger
0
330
Swiss Army Django: Small Footprint ETL - DjangoCon US
coderanger
0
83
How to look at space: PyCon AU
coderanger
0
140
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
S3ストレージクラスの「見える」「ある」「使える」は全部違う ─ 体験から見た、仕様の深淵を覗く
ya_ma23
0
1.2k
今こそ押さえておきたい アマゾンウェブサービス(AWS)の データベースの基礎 おもクラ #6版
satoshi256kbyte
1
210
Migration to Signals, Signal Forms, Resource API, and NgRx Signal Store @Angular Days 03/2026 Munich
manfredsteyer
PRO
0
200
我々はなぜ「層」を分けるのか〜「関心の分離」と「抽象化」で手に入れる変更に強いシンプルな設計〜 #phperkaigi / PHPerKaigi 2026
shogogg
2
720
野球解説AI Agentを開発してみた - 2026/02/27 LayerX社内LT会資料
shinyorke
PRO
0
380
KagglerがMixSeekを触ってみた
morim
0
360
AI 開発合宿を通して得た学び
niftycorp
PRO
0
180
OTP を自動で入力する裏技
megabitsenmzq
0
130
Understanding Apache Lucene - More than just full-text search
spinscale
0
150
20260313 - Grafana & Friends Taipei #1 - Kubernetes v1.36 的開發雜記:那些困在 Alpha 加護病房太久的 Metrics
tico88612
0
240
Cyrius ーLinux非依存にコンテナをネイティブ実行する専用OSー
n4mlz
0
260
AWS×クラウドネイティブソフトウェア設計 / AWS x Cloud-Native Software Design
nrslib
16
3.5k
Featured
See All Featured
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
10k
Building the Perfect Custom Keyboard
takai
2
720
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.3k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
400
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.1k
Navigating Weather and Climate Data
rabernat
0
150
Git: the NoSQL Database
bkeepers
PRO
432
67k
Site-Speed That Sticks
csswizardry
13
1.1k
Producing Creativity
orderedlist
PRO
348
40k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
250
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