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
Puppet + Ruby DSL
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Mateusz Lenik
May 23, 2012
Technology
260
1
Share
Puppet + Ruby DSL
Short talk in Polish on Puppet and it's Ruby DSL
Mateusz Lenik
May 23, 2012
More Decks by Mateusz Lenik
See All by Mateusz Lenik
summon_process - orchestrating processes
mlen
0
73
Why you should give Erlang
mlen
1
150
Introduction to Erlang (in Polish)
mlen
1
110
Other Decks in Technology
See All in Technology
拝啓、あの夏の僕へ〜あなたも知っているApp Runnerの世界〜
news_it_enj
0
160
AWS Transform CustomでIaCコードを自由自在に変換しよう
duelist2020jp
0
220
FessのAI検索モード:検索システムとLLMへの取り組み
marevol
0
160
知ってた?JavaScriptの"正しさ"を検証するテストが5万以上もあること(Test262)
riyaamemiya
0
110
20260428_Product Management Summit_tadokoroyoshiro
tadokoro_yoshiro
15
17k
変化の激しい時代をゴキゲンに生き抜くために 〜ストレスマネジメントのススメ〜
kakehashi
PRO
1
530
Scovilleモバイルエンジニア募集中.pdf
julienrudin
0
140
ServiceNow Knowledge 26 の歩き方
manarobot
0
270
AI와 협업하는 조직으로의 여정
arawn
0
570
ボトムアップの改善の火を灯し続けろ!〜支援現場で学んだ、消えないための3つの打ち手〜 / 20260509 Kazuki Mori
shift_evolve
PRO
2
280
巨大プラットフォームを進化させる「第3のROI」
recruitengineers
PRO
2
2k
GitHub Copilot Dev Days
tomokusaba
0
120
Featured
See All Featured
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.5k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
10k
Rails Girls Zürich Keynote
gr2m
96
14k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
Chasing Engaging Ingredients in Design
codingconduct
0
180
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
550
RailsConf 2023
tenderlove
30
1.4k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
140
Practical Orchestrator
shlominoach
191
11k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
180
Transcript
Puppet + Ruby DSL Mateusz Lenik
Kim jestem?
• Mateusz Lenik • @_mlen, github.com/mlen • student III roku
Informatyki na PWr • użytkownik Ruby od 2010 • uczestnik GSoC 2012 @PuppetLabs
Czym jest Puppet?
None
• system zarządzania konfiguracją • konfiguracja jako kod • co
ma być zrobione, a nie jak ma być zrobione
Puppet Puppet Enterprise Puppet OpenSource
• podstawa dla Puppet Enterprise • ponad 350 modułów +
PuppetForge • konieczność własnego zarządzanie serwerem konfiguracji Puppet OpenSource
• Puppet OpenSource • + Support 24/7/365 • + GUI
webowe Puppet Enterprise
• kod wykonywany na serwerze • deklaratywny • jawne zależności
• template’y ERB • Puppet DSL • kod wykonywany na kliencie • deklaratywny • ukryte zależności • kiepska obsługa template’ów • CFEngine syntax Puppet vs CFEngine
• kod wykonywany na serwerze • deklaratywny • jawne zależności
• template’y ERB • Puppet DSL • kod wykonywany na kliencie • deklaratywny • ukryte zależności • template’y ERB • It’s Ruby! Puppet vs Chef
Kompilacja Kod Katalog Raport Wykonanie
• Fakty • Zasoby • Klasy • Węzły Katalog
Node Puppet Master Fakty
Node Puppet Master Katalog
Node Puppet Master Raport
Puppet DSL
• język deklaratywny • projektowany pod administratorów • wystarcza w
większości zastosowań
• nie da się w nim zrobić wszystkiego • ograniczone
instrukcje sterujące • specyficzna składnia “<|| ||>”
Ruby DSL
• dodany w ~2010 • lib/puppet/dsl/*.rb • nie dodaje zbyt
wiele abstrakcji
• gołe obiekty Puppet::Parser::* • brak części funkcjonalności • projekt
GSoC 2012 – rozwój Ruby DSL
None
Przykłady
class foo { notice("foo") } node "default" { include foo
} Klasy
hostclass :foo do notice ["foo"] end node "default" do create_resource
:class, :foo end Klasy
hostclass :foo do notice "foo" end node "default" do use
:foo end Klasy
class foo ($param = "value") { notice($param) } node "default"
{ class { "foo": param => "foo" } } Parametry
hostclass :foo, :arguments => {"param" => AST::String.new(:value => "value")} do
notice [scope.lookupvar("param")] end node "default" do create_resource :class, :foo, :param => "foo" end Parametry
hostclass :foo, :arguments => {:param => "value"} do notice params[:param]
end node "default" do use :foo, :param => "foo" end Parametry
node "default" { Notify { message => "foo" } notify
{"bar": } } Defaults
node "default" do scope.setdefaults(:notify, [Puppet::Parser::Resource::Param.new( :name => "message",:value => "foo"
)] ) notify "bar" end Defaults
node "default" do Notify :message => "foo" notify "bar" end
Defaults
Dalszy rozwój • Konwerter *.pp do *.rb • Inny DSL?
(Rake vs Thor)
Q&A