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
700
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
38
What Python Can Learn From Other Languages (with notes)
coderanger
0
120
Swiss Army Django: Small Footprint ETL (with notes) - DjangoCon US
coderanger
0
190
Swiss Army Django: Small Footprint ETL - DjangoCon US
coderanger
0
44
How to look at space: PyCon AU
coderanger
0
85
Swiss Army Django: Small Footprint ETL
coderanger
0
71
Swiss Army Django: Small Footprint ETL (with notes)
coderanger
0
66
Minimum Viable Kubernetes
coderanger
0
30
Minimum Viable Kubernetes (with notes)
coderanger
0
390
Other Decks in Programming
See All in Programming
15分で学ぶDuckDBの可愛い使い方 DuckDBの最近の更新
notrogue
1
320
Bedrock Agentsレスポンス解析によるAgentのOps
licux
3
890
Djangoにおける複数ユーザー種別認証の設計アプローチ@DjangoCongress JP 2025
delhi09
PRO
4
410
pylint custom ruleで始めるレビュー自動化
shogoujiie
0
140
Conform を推す - Advocating for Conform
mizoguchicoji
3
710
Code smarter, not harder - How AI Coding Tools Boost Your Productivity | Angular Meetup Berlin
danielsogl
0
100
コミュニティ駆動 AWS CDK ライブラリ「Open Constructs Library」 / community-cdk-library
gotok365
2
200
Better Code Design in PHP
afilina
0
150
メンテが命: PHPフレームワークのコンテナ化とアップグレード戦略
shunta27
0
280
CloudNativePGを布教したい
nnaka2992
0
100
苦しいTiDBへの移行を乗り越えて快適な運用を目指す
leveragestech
0
890
Software Architecture
hschwentner
6
2.1k
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
133
9.1k
Gamification - CAS2011
davidbonilla
80
5.1k
Making Projects Easy
brettharned
116
6k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.2k
4 Signs Your Business is Dying
shpigford
182
22k
Raft: Consensus for Rubyists
vanstee
137
6.8k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
The Invisible Side of Design
smashingmag
299
50k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
10
1.3k
Into the Great Unknown - MozCon
thekraken
35
1.6k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.2k
Six Lessons from altMBA
skipperchong
27
3.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