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
Mateusz Lenik
May 23, 2012
Technology
1
250
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
69
Why you should give Erlang
mlen
1
140
Introduction to Erlang (in Polish)
mlen
1
100
Other Decks in Technology
See All in Technology
コスト削減の基本の「キ」~ コスト消費3大リソースへの対策 ~
smt7174
2
300
ヘブンバーンズレッドにおける、世界観を活かしたミニゲーム企画の作り方
gree_tech
PRO
0
380
自社製CMSからmicroCMSへのリプレースがプロダクトグロースを加速させた話
nextbeatdev
0
400
シークレット管理だけじゃない!HashiCorp Vault でデータ暗号化をしよう / Beyond Secret Management! Let's Encrypt Data with HashiCorp Vault
nnstt1
2
130
「魔法少女まどか☆マギカ Magia Exedra」での負荷試験の実践と学び
gree_tech
PRO
0
390
【 LLMエンジニアがヒューマノイド開発に挑んでみた 】 - 第104回 Machine Learning 15minutes! Hybrid
soneo1127
0
210
Bye-Bye Query Spaghetti: Write Queries You'll Actually Understand Using Pipelined SQL Syntax
tobiaslampertlotum
0
110
【Grafana Meetup Japan #6】Grafanaをリバプロ配下で動かすときにやること ~ Grafana Liveってなんだ ~
yoshitake945
0
200
まだ間に合う! StrandsとBedrock AgentCoreでAIエージェント構築に入門しよう
minorun365
PRO
10
610
実践アプリケーション設計 ③ドメイン駆動設計
recruitengineers
PRO
13
3.8k
モバイルアプリ研修
recruitengineers
PRO
5
1.6k
退屈なことはDevinにやらせよう〜〜Devin APIを使ったVisual Regression Testの自動追加〜
kawamataryo
4
950
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
43
7.5k
Designing for Performance
lara
610
69k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
61k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3k
Automating Front-end Workflow
addyosmani
1370
200k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.4k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
36
2.5k
The Language of Interfaces
destraynor
160
25k
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