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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Noah Kantrowitz
April 16, 2014
Programming
780
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Poise: Reusable Cookbook Patterns
Noah Kantrowitz
April 16, 2014
Transcript
46 slides
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
More Decks by Noah Kantrowitz
See All by Noah Kantrowitz
Fine Print: Intellectual Property for Engineers
coderanger
0
29
Fine Print: Intellectual Property for Engineers (with notes)
coderanger
0
71
I Am Bad At Things
coderanger
0
40
I Am Bad At Things (with notes)
coderanger
0
95
The Long Hello World
coderanger
0
58
The Long Hello World (with notes)
coderanger
0
200
What Python Can Learn From Other Languages
coderanger
0
120
What Python Can Learn From Other Languages (with notes)
coderanger
0
300
Swiss Army Django: Small Footprint ETL (with notes) - DjangoCon US
coderanger
0
440
Other Decks in Programming
See All in Programming
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
620
AppFunctionsの内部実装を紐解く
hiroaki404
1
130
React Native経験者が Flutterを30⽇間触って驚いたこと
3saito
0
210
LLM 101: Exploring LLMs, Starting with Tokens.
dalinaum
0
120
baseline으로 마이그레이션, 리팩토링 안전하게 맡기기
fornewid
1
1.1k
Debian JP Projectのサーバー構成
uwabami
1
190
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
450
どうしても Eloquent でリポジトリパターンをやりたいんだ #phpcon_niigata / phpcon-niigata-2026
shogogg
0
710
地方こそサーバーレス — 10年続けた、顔が見えるチームで確かな基盤を / Serverless Matters Most in Regional Areas — 10 Years of Building Reliable Foundations with Close-Knit Teams
seike460
PRO
2
520
Rails初心者がパスキーを実装してみて大変だったこと
ktombow
0
250
joyful-journey-spring-boot.pdf
hollycummins
0
130
JavaScriptはシングルバイナリの夢を見るか / Does JavaScript Dream of a Single Binary?
ssssota
1
1.2k
Featured
See All Featured
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
1k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
HDC tutorial
michielstock
2
1k
Darren the Foodie - Storyboard
khoart
PRO
5
4.1k
Code Reviewing Like a Champion
maltzj
529
40k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8.3k
Highjacked: Video Game Concept Design
rkendrick25
PRO
2
600
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Accessibility Awareness
sabderemane
1
320
Paper Plane (Part 1)
katiecoart
PRO
3
12k
Heart Work Chapter 1 - Part 1
lfama
PRO
11
37k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
370