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
65
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
64
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
85
Minimum Viable Kubernetes
coderanger
0
41
Minimum Viable Kubernetes (with notes)
coderanger
0
460
Other Decks in Programming
See All in Programming
AIコーディングAgentとの向き合い方
eycjur
0
250
TDD 実践ミニトーク
contour_gara
1
280
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
200
Claude Codeで挑むOSSコントリビュート
eycjur
0
190
CloudflareのChat Agent Starter Kitで簡単!AIチャットボット構築
syumai
2
400
The state patternの実践 個人開発で培ったpractice集
miyanokomiya
0
160
UbieのAIパートナーを支えるコンテキストエンジニアリング実践
syucream
2
820
詳解!defer panic recover のしくみ / Understanding defer, panic, and recover
convto
0
220
Swift Updates - Learn Languages 2025
koher
2
440
TanStack DB ~状態管理の新しい考え方~
bmthd
2
470
Testing Trophyは叫ばない
toms74209200
0
670
奥深くて厄介な「改行」と仲良くなる20分
oguemon
1
410
Featured
See All Featured
Code Review Best Practice
trishagee
70
19k
Building Adaptive Systems
keathley
43
2.7k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.5k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
580
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.6k
How to Think Like a Performance Engineer
csswizardry
26
1.9k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
30
9.6k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Optimizing for Happiness
mojombo
379
70k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Building Applications with DynamoDB
mza
96
6.6k
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