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
1
260
Puppet + Ruby DSL
Short talk in Polish on Puppet and it's Ruby DSL
Mateusz Lenik
May 23, 2012
Tweet
Share
More Decks by Mateusz Lenik
See All by Mateusz Lenik
summon_process - orchestrating processes
mlen
0
72
Why you should give Erlang
mlen
1
150
Introduction to Erlang (in Polish)
mlen
1
110
Other Decks in Technology
See All in Technology
データ民主化のための LLM 活用状況と課題紹介(IVRy の場合)
wxyzzz
2
680
We Built for Predictability; The Workloads Didn’t Care
stahnma
0
130
仕様書駆動AI開発の実践: Issue→Skill→PRテンプレで 再現性を作る
knishioka
2
610
Context Engineeringが企業で不可欠になる理由
hirosatogamo
PRO
3
440
ブロックテーマでサイトをリニューアルした話 / 2026-01-31 Kansai WordPress Meetup
torounit
0
460
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
3.8k
こんなところでも(地味に)活躍するImage Modeさんを知ってるかい?- Image Mode for OpenShift -
tsukaman
0
110
Amazon S3 Vectorsを使って資格勉強用AIエージェントを構築してみた
usanchuu
3
440
外部キー制約の知っておいて欲しいこと - RDBMSを正しく使うために必要なこと / FOREIGN KEY Night
soudai
PRO
12
4.9k
usermode linux without MMU - fosdem2026 kernel devroom
thehajime
0
220
Agile Leadership Summit Keynote 2026
m_seki
1
530
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
10k
Featured
See All Featured
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
160
Raft: Consensus for Rubyists
vanstee
141
7.3k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.2k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.3k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
380
A Tale of Four Properties
chriscoyier
162
24k
GraphQLとの向き合い方2022年版
quramy
50
14k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
55
Google's AI Overviews - The New Search
badams
0
900
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
110
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
3.9k
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