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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
MCPでつなぐElasticsearchとLLM - 深夜の障害対応を楽にしたい / Bridging Elasticsearch and LLMs with MCP
sashimimochi
0
150
【Oracle Cloud ウェビナー】[Oracle AI Database + AWS] Oracle Database@AWSで広がるクラウドの新たな選択肢とAI時代のデータ戦略
oracle4engineer
PRO
1
110
15 years with Rails and DDD (AI Edition)
andrzejkrzywda
0
180
Cosmos World Foundation Model Platform for Physical AI
takmin
0
740
Context Engineeringが企業で不可欠になる理由
hirosatogamo
PRO
3
530
AWS Network Firewall Proxyを触ってみた
nagisa53
0
200
SREのプラクティスを用いた3領域同時 マネジメントへの挑戦 〜SRE・情シス・セキュリティを統合した チーム運営術〜
coconala_engineer
2
630
We Built for Predictability; The Workloads Didn’t Care
stahnma
0
140
OWASP Top 10:2025 リリースと 少しの日本語化にまつわる裏話
okdt
PRO
3
590
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1k
インフラエンジニア必見!Kubernetesを用いたクラウドネイティブ設計ポイント大全
daitak
0
340
Tebiki Engineering Team Deck
tebiki
0
24k
Featured
See All Featured
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
200
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Docker and Python
trallard
47
3.7k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.9k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
57
50k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
160
How to build a perfect <img>
jonoalderson
1
4.9k
What's in a price? How to price your products and services
michaelherold
247
13k
Claude Code のすすめ
schroneko
67
210k
Test your architecture with Archunit
thirion
1
2.1k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.7k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
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