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
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
組織のSREを推進するためのPlatform EngineeringとEKS / Platform Engineering and EKS to drive SRE in your organization
chmikata
0
180
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
44k
A Gentle Introduction to Transformers
keio_smilab
PRO
1
170
Digitization部 紹介資料
sansan33
PRO
1
7k
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
15
95k
開発組織の課題解決を加速するための権限委譲 -する側、される側としての向き合い方-
daitasu
5
250
Oracle Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
1.6k
Lookerの最新バージョンv26.2がやばい話
waiwai2111
1
160
Security Diaries of an Open Source IAM
ahus1
0
200
ヘルシーSRE
tk3fftk
2
240
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
3k
トップマネジメントとコンピテンシーから考えるエンジニアリングマネジメント
zigorou
4
550
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
300
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
620
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
63
53k
sira's awesome portfolio website redesign presentation
elsirapls
0
180
GitHub's CSS Performance
jonrohan
1032
470k
Speed Design
sergeychernyshev
33
1.6k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
What's in a price? How to price your products and services
michaelherold
247
13k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
140
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
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