SlideShare ist ein Scribd-Unternehmen logo
1 von 70
Downloaden Sie, um offline zu lesen
2014 
Presented by 
The Grand Puppet 
Sub-Systems Tour 
Nick Fagerlund 
Technical Writer / Weird Bugs | Puppet 
Labs 
@nfagerlund
Presented by 
PIPES
Presented by 
What does Puppet DO? 
• Gather system information 
• Compile a catalog 
• Apply catalog 
• Report
Presented by 
What does Puppet DO? 
AGENT 
• Gather system 
information 
• Apply catalog 
• Report 
MASTER 
• Compile a catalog
STOP 1: Command Line and the 
Presented by
Presented by 
Someone ran puppet agent
Presented by 
??? 
• /opt/puppet/bin/puppet 
• Puppet::Util::CommandLine.new.execute 
• Puppet::Application.find 
• Puppet::Application::Agent.new 
• Puppet::Application::Agent#setup 
• Puppet::Application::Agent#run_command
Presented by 
#run_command 
# 
lib/puppet/application/agent.rb 
def 
run_command 
if 
options[:fingerprint] 
fingerprint 
else 
# 
It'd 
be 
nice 
to 
daemonize 
later, 
but 
we 
have 
to 
daemonize 
before 
# 
waiting 
for 
certificates 
so 
that 
we 
don't 
block 
daemon 
= 
daemonize_process_when(Puppet[:daemonize]) 
! 
wait_for_certificates 
! 
if 
Puppet[:onetime] 
onetime(daemon) 
else 
main(daemon) 
end
Presented by 
onetime() and main() 
# 
lib/puppet/application/agent.rb 
begin 
exitstatus 
= 
daemon.agent.run 
rescue 
=> 
detail 
Puppet.log_exception(detail) 
end 
! 
daemon.stop(:exit 
=> 
false) 
! 
if 
not 
exitstatus 
exit(1) 
elsif 
options[:detailed_exitcodes] 
then 
exit(exitstatus) 
else 
exit(0) 
end 
# 
lib/puppet/application/agent.rb 
def 
main(daemon) 
if 
Puppet[:listen] 
setup_listen(daemon) 
end 
Puppet.notice 
"Starting 
Puppet 
client 
version 
#{Puppet.version}" 
! 
daemon.start 
end
Presented by 
Obtaining the daemon 
# 
lib/puppet/application/agent.rb 
def 
daemonize_process_when(should_daemonize) 
daemon 
= 
Puppet::Daemon.new(Puppet::Util::Pidlock.new(Puppet[:pidfile])) 
daemon.argv 
= 
@argv 
daemon.agent 
= 
@agent 
! 
daemon.daemonize 
if 
should_daemonize 
! 
daemon 
end
STOP 2: The Daemon and the 
Presented by
Presented by 
DAEMON LAND?! 
Nope 
Bye
Presented by 
Puppet::Agent 
• Run a thing
Presented by 
Puppet::Daemon 
• Run a thing that runs the other thing
Lots of layers of abstraction?? 
• Historical reasons! 
Presented by
Presented by 
STOP 3: The Configurer
Presented by 
Puppet::Configurer
Puppet::Configurer#run_internal 
Presented by 
# 
lib/puppet/configurer.rb 
def 
run_internal(options) 
# 
We 
create 
the 
report 
pre-­‐populated 
with 
default 
settings 
for 
# 
environment 
and 
transaction_uuid 
very 
early, 
this 
is 
to 
ensure 
# 
they 
are 
sent 
regardless 
of 
any 
catalog 
compilation 
failures 
or 
# 
exceptions. 
options[:report] 
||= 
Puppet::Transaction::Report.new("apply", 
nil, 
@environment, 
@transaction_uuid) 
report 
= 
options[:report] 
init_storage 
! 
Puppet::Util::Log.newdestination(report) 
… 
… 
…
Puppet::Configurer#run_internal 
Presented by 
# 
lib/puppet/configurer.rb 
… 
query_options 
= 
get_facts(options) 
unless 
query_options 
…
Puppet::Configurer#run_internal 
Presented by 
# 
lib/puppet/configurer/fact_handler.rb 
… 
facts 
= 
Puppet::Node::Facts.indirection.find(Puppet[:node_name_value], 
:environment 
=> 
@environment) 
…
Puppet::Configurer#run_internal 
Presented by 
# 
lib/puppet/configurer.rb 
… 
unless 
catalog 
= 
prepare_and_retrieve_catalog(options, 
query_options) 
return 
nil 
end 
…
Puppet::Configurer#run_internal 
Presented by 
# 
lib/puppet/configurer.rb 
… 
apply_catalog(catalog, 
options) 
…
Presented by 
Where next? 
Retrieve Apply
STOP 4: The Transaction 
Presented by
Presented by 
(Puppet::Resource::Catalog)
Presented by 
Puppet::Resource::Catalog 
Catalog 
Resource Other 
Stuff
Presented by 
Puppet::Configurer (again) 
# 
lib/puppet/configurer.rb 
def 
convert_catalog(result, 
duration) 
catalog 
= 
result.to_ral 
catalog.finalize 
catalog.retrieval_duration 
= 
duration 
catalog.write_class_file 
catalog.write_resource_file 
catalog 
end
Presented by 
RAL Catalog
Presented by 
RAL Catalog 
# 
lib/puppet/resource/catalog.rb 
def 
to_catalog(convert) 
result 
= 
self.class.new(self.name, 
self.environment_instance) 
result.version 
= 
self.version 
map 
= 
{} 
resources.each 
do 
|resource| 
next 
if 
virtual_not_exported?(resource) 
next 
if 
block_given? 
and 
yield 
resource 
newres 
= 
resource.copy_as_resource 
newres.catalog 
= 
result 
if 
convert 
!= 
:to_resource 
newres 
= 
newres.to_ral 
end 
# 
We 
can't 
guarantee 
that 
resources 
don't 
munge 
their 
names 
# 
(like 
files 
do 
with 
trailing 
slashes), 
so 
we 
have 
to 
keep 
track 
# 
of 
what 
a 
resource 
got 
converted 
to. 
map[resource.ref] 
= 
newres 
result.add_resource 
newres 
end
Presented by 
RAL Catalog 
Puppet::Resource 
! 
↓ 
! 
(something) << Puppet::Type
Presented by 
RAL Catalog 
???
Presented by 
RAL Catalog 
# 
lib/puppet/configurer.rb 
def 
apply_catalog(catalog, 
options) 
report 
= 
options[:report] 
report.configuration_version 
= 
catalog.version 
! 
benchmark(:notice, 
"Finished 
catalog 
run") 
do 
catalog.apply(options) 
end 
! 
report.finalize_report 
report 
end
Puppet::Resource::Catalog#apply 
Presented by 
# 
lib/puppet/resource/catalog.rb 
def 
apply(options 
= 
{}) 
Puppet::Util::Storage.load 
if 
host_config? 
! 
transaction 
= 
create_transaction(options) 
! 
begin 
transaction.report.as_logging_destination 
do 
transaction.evaluate 
end 
rescue 
Puppet::Error 
=> 
detail 
!
Presented by 
Transaction 
???
Presented by 
Transaction 
• Ral catalog 
• Prioritizer 
• Report
Presented by 
Transaction 
• Ral catalog 
• Prioritizer 
• Report 
• Event manager 
• Resource harness 
• Relationship graph
Presented by 
Transaction 
• Ral catalog 
• Prioritizer 
• Report 
• Event manager 
• Resource harness 
• Relationship graph 
• relationship_graph.traverse
Presented by 
Transaction 
• Ral catalog 
• Prioritizer 
• Report 
• Event manager 
• Resource harness 
• Relationship graph 
• relationship_graph.traverse 
• *ollies out*
Presented by 
STOP 5: The Indirector
Presented by 
Back to Puppet::Configurer 
• #prepare_and_retrieve_catalog
Presented by 
Back to Puppet::Configurer 
# 
lib/puppet/configurer.rb 
result 
= 
Puppet::Resource::Catalog.indirection.find( 
Puppet[:node_name_value], 
query_options.merge(:ignore_cache 
=> 
true, 
:environment 
=> 
@environment, 
:fail_on_404 
=> 
true) 
)
Presented by 
The Indirector 
! 
Puppet::Resource::Catalog.indirection.find()
Presented by 
The Indirector 
← 
↑ 
↓ 
?
Presented by 
The Indirector 
• Globally configured 
• Abstract 
• Gets stuff for you
Presented by 
The Indirector 
# 
lib/puppet/resource/catalog.rb 
extend 
Puppet::Indirector 
indirects 
:catalog, 
:terminus_setting 
=> 
:catalog_terminus
Presented by 
The Indirector 
• find 
• search 
• save 
• destroy
Presented by 
The Indirector 
• find 
• search 
• save 
• destroy 
• terminus_class 
• cache_class 
• lib/puppet/indirector/…
Presented by 
Puppet Agent 
• Catalog => REST 
• Report => REST 
• Facts => Facter
Presented by 
Puppet Apply 
• Catalog => Compiler 
• Report => Processor 
• Facts => Facter
Presented by 
Avoiding the cache 
# 
lib/puppet/configurer.rb 
result 
= 
Puppet::Resource::Catalog.indirection.find( 
Puppet[:node_name_value], 
query_options.merge(:ignore_cache 
=> 
true, 
:environment 
=> 
@environment, 
:fail_on_404 
=> 
true) 
)
Presented by 
The Indirector 
• Why?
Presented by 
The Indirector 
• Why? 
• Global? Rigid?
Presented by 
The Indirector 
• Why? 
• Global? Rigid? 
• IT MAKES SENSE IN CONTEXT
Presented by 
The Indirector 
• …Catalog.find( <FACTS> ) 
• REST terminus 
• HTTP POST request to master
STOP 6: The Puppet Master’s 
Presented by
Presented by 
Rack 
Web server 
↓ 
Rack server 
↓ 
“App” object that responds to #call() 
↓ 
Actual application logic
Presented by 
config.ru 
$0 
= 
"master" 
! 
ARGV 
<< 
"-­‐-­‐rack" 
! 
ARGV 
<< 
"-­‐-­‐confdir" 
<< 
"/etc/puppet" 
ARGV 
<< 
"-­‐-­‐vardir" 
<< 
"/var/lib/puppet" 
! 
require 
'puppet/util/command_line' 
run 
Puppet::Util::CommandLine.new.execute 
!
Presented by 
Starting master w/ Rack 
# 
lib/puppet/application/master.rb 
def 
start_rack_master 
require 
'puppet/network/http/rack' 
! 
announce_start_of_master 
! 
return 
Puppet::Network::HTTP::Rack.new() 
end
Presented by 
The app object 
# 
lib/puppet/network/http/rack.rb 
class 
Puppet::Network::HTTP::Rack 
def 
call(env) 
request 
= 
Rack::Request.new(env) 
response 
= 
Rack::Response.new 
Puppet.debug 
'Handling 
request: 
%s 
%s' 
% 
[request.request_method, 
request.fullpath] 
! 
begin 
Puppet::Network::HTTP::RackREST.new.process(request, 
response) 
rescue 
=> 
detail 
# 
Send 
a 
Status 
500 
Error 
on 
unhandled 
exceptions. 
response.status 
= 
500 
response['Content-­‐Type'] 
= 
'text/plain' 
response.write 
'Internal 
Server 
Error: 
"%s"' 
% 
detail.message 
# 
log 
what 
happened 
Puppet.log_exception(detail, 
"Puppet 
Server 
(Rack): 
Internal 
Server 
Error: 
Unhandled 
Exception: 
"%s"" 
% 
detail.message) 
end 
response.finish
Presented by 
#process 
# 
lib/puppet/network/http/handler.rb 
def 
process(request, 
response) 
new_response 
= 
Puppet::Network::HTTP::Response.new(self, 
response) 
! 
request_headers 
= 
headers(request) 
request_params 
= 
params(request) 
request_method 
= 
http_method(request) 
request_path 
= 
path(request) 
… 
!
Presented by 
#process 
# 
lib/puppet/network/http/handler.rb 
if 
route 
= 
@routes.find 
{ 
|route| 
route.matches?(new_request) 
} 
route.process(new_request, 
new_response)
lib/puppet/network/http/api/v1.rb 
Presented by
lib/puppet/network/http/api/v1.rb 
• GET => indirection.find() 
• POST => indirection.find() (for catalogs) 
• (There was an issue with some servers rejecting GET 
parameters that were too long. Funny story about that.) 
• DELETE => indirection.destroy() 
• PUT => indirection.save() 
• GET to magical plural name => indirection.search() 
Presented by
Presented by 
BIG PICTURE 
Configurer calls catalog.indirection.find() 
↓ 
HTTP POST request to master 
↓ 
Request handler calls catalog.indirection.find() 
↓ 
Compiler terminus handles it 
↓
Presented by 
STOP 7: The Compiler
Presented by 
MOSTLY SKIPPING THIS 
Lexer 
↓ 
Parser 
↓ 
AST 
↓ 
Evaluator 
↓
Presented by 
THIS IS THE TEST 
“Compiler terminus to the catalog 
indirection” 
! 
???
Presented by 
THIS IS THE TEST 
GOOD WORK 
EVERYBODY!
Presented by 
Questions?
Presented by 
THANKS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
•Hope we’ll see you next year in 
Portland!

Weitere ähnliche Inhalte

Was ist angesagt?

What we Learned Implementing Puppet at Backstop
What we Learned Implementing Puppet at BackstopWhat we Learned Implementing Puppet at Backstop
What we Learned Implementing Puppet at BackstopPuppet
 
Can you upgrade to Puppet 4.x? (Beginner) Can you upgrade to Puppet 4.x? (Beg...
Can you upgrade to Puppet 4.x? (Beginner) Can you upgrade to Puppet 4.x? (Beg...Can you upgrade to Puppet 4.x? (Beginner) Can you upgrade to Puppet 4.x? (Beg...
Can you upgrade to Puppet 4.x? (Beginner) Can you upgrade to Puppet 4.x? (Beg...Puppet
 
Puppet Performance Profiling
Puppet Performance ProfilingPuppet Performance Profiling
Puppet Performance Profilingripienaar
 
Refactor Dance - Puppet Labs 'Best Practices'
Refactor Dance - Puppet Labs 'Best Practices'Refactor Dance - Puppet Labs 'Best Practices'
Refactor Dance - Puppet Labs 'Best Practices'Gary Larizza
 
External Data in Puppet 4
External Data in Puppet 4External Data in Puppet 4
External Data in Puppet 4ripienaar
 
Orchestrated Functional Testing with Puppet-spec and Mspectator - PuppetConf ...
Orchestrated Functional Testing with Puppet-spec and Mspectator - PuppetConf ...Orchestrated Functional Testing with Puppet-spec and Mspectator - PuppetConf ...
Orchestrated Functional Testing with Puppet-spec and Mspectator - PuppetConf ...Puppet
 
Object Trampoline: Why having not the object you want is what you need.
Object Trampoline: Why having not the object you want is what you need.Object Trampoline: Why having not the object you want is what you need.
Object Trampoline: Why having not the object you want is what you need.Workhorse Computing
 
CPANTS: Kwalitative website and its tools
CPANTS: Kwalitative website and its toolsCPANTS: Kwalitative website and its tools
CPANTS: Kwalitative website and its toolscharsbar
 
The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.Workhorse Computing
 
Rugged Driven Development with Gauntlt
Rugged Driven Development with GauntltRugged Driven Development with Gauntlt
Rugged Driven Development with GauntltJames Wickett
 
Ansible leveraging 2.0
Ansible leveraging 2.0Ansible leveraging 2.0
Ansible leveraging 2.0bcoca
 
Keeping objects healthy with Object::Exercise.
Keeping objects healthy with Object::Exercise.Keeping objects healthy with Object::Exercise.
Keeping objects healthy with Object::Exercise.Workhorse Computing
 
Puppet camp chicago-automated_testing2
Puppet camp chicago-automated_testing2Puppet camp chicago-automated_testing2
Puppet camp chicago-automated_testing2nottings
 
The Puppet Debugging Kit: Building Blocks for Exploration and Problem Solving...
The Puppet Debugging Kit: Building Blocks for Exploration and Problem Solving...The Puppet Debugging Kit: Building Blocks for Exploration and Problem Solving...
The Puppet Debugging Kit: Building Blocks for Exploration and Problem Solving...Puppet
 
Tracking huge files with Git LFS (GlueCon 2016)
Tracking huge files with Git LFS (GlueCon 2016)Tracking huge files with Git LFS (GlueCon 2016)
Tracking huge files with Git LFS (GlueCon 2016)Tim Pettersen
 
PuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetPuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetWalter Heck
 

Was ist angesagt? (20)

What we Learned Implementing Puppet at Backstop
What we Learned Implementing Puppet at BackstopWhat we Learned Implementing Puppet at Backstop
What we Learned Implementing Puppet at Backstop
 
Can you upgrade to Puppet 4.x? (Beginner) Can you upgrade to Puppet 4.x? (Beg...
Can you upgrade to Puppet 4.x? (Beginner) Can you upgrade to Puppet 4.x? (Beg...Can you upgrade to Puppet 4.x? (Beginner) Can you upgrade to Puppet 4.x? (Beg...
Can you upgrade to Puppet 4.x? (Beginner) Can you upgrade to Puppet 4.x? (Beg...
 
Memory Manglement in Raku
Memory Manglement in RakuMemory Manglement in Raku
Memory Manglement in Raku
 
Unit Testing Lots of Perl
Unit Testing Lots of PerlUnit Testing Lots of Perl
Unit Testing Lots of Perl
 
Puppet Performance Profiling
Puppet Performance ProfilingPuppet Performance Profiling
Puppet Performance Profiling
 
Refactor Dance - Puppet Labs 'Best Practices'
Refactor Dance - Puppet Labs 'Best Practices'Refactor Dance - Puppet Labs 'Best Practices'
Refactor Dance - Puppet Labs 'Best Practices'
 
External Data in Puppet 4
External Data in Puppet 4External Data in Puppet 4
External Data in Puppet 4
 
Orchestrated Functional Testing with Puppet-spec and Mspectator - PuppetConf ...
Orchestrated Functional Testing with Puppet-spec and Mspectator - PuppetConf ...Orchestrated Functional Testing with Puppet-spec and Mspectator - PuppetConf ...
Orchestrated Functional Testing with Puppet-spec and Mspectator - PuppetConf ...
 
Object Trampoline: Why having not the object you want is what you need.
Object Trampoline: Why having not the object you want is what you need.Object Trampoline: Why having not the object you want is what you need.
Object Trampoline: Why having not the object you want is what you need.
 
CPANTS: Kwalitative website and its tools
CPANTS: Kwalitative website and its toolsCPANTS: Kwalitative website and its tools
CPANTS: Kwalitative website and its tools
 
The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.The $path to knowledge: What little it take to unit-test Perl.
The $path to knowledge: What little it take to unit-test Perl.
 
Rugged Driven Development with Gauntlt
Rugged Driven Development with GauntltRugged Driven Development with Gauntlt
Rugged Driven Development with Gauntlt
 
Ansible leveraging 2.0
Ansible leveraging 2.0Ansible leveraging 2.0
Ansible leveraging 2.0
 
Git::Hooks
Git::HooksGit::Hooks
Git::Hooks
 
Keeping objects healthy with Object::Exercise.
Keeping objects healthy with Object::Exercise.Keeping objects healthy with Object::Exercise.
Keeping objects healthy with Object::Exercise.
 
Picconf12
Picconf12Picconf12
Picconf12
 
Puppet camp chicago-automated_testing2
Puppet camp chicago-automated_testing2Puppet camp chicago-automated_testing2
Puppet camp chicago-automated_testing2
 
The Puppet Debugging Kit: Building Blocks for Exploration and Problem Solving...
The Puppet Debugging Kit: Building Blocks for Exploration and Problem Solving...The Puppet Debugging Kit: Building Blocks for Exploration and Problem Solving...
The Puppet Debugging Kit: Building Blocks for Exploration and Problem Solving...
 
Tracking huge files with Git LFS (GlueCon 2016)
Tracking huge files with Git LFS (GlueCon 2016)Tracking huge files with Git LFS (GlueCon 2016)
Tracking huge files with Git LFS (GlueCon 2016)
 
PuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetPuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of Puppet
 

Andere mochten auch

Automating Node Classification
Automating Node ClassificationAutomating Node Classification
Automating Node ClassificationPuppet
 
Node Classifier Fundamentals - PuppetConf 2014
Node Classifier Fundamentals - PuppetConf 2014Node Classifier Fundamentals - PuppetConf 2014
Node Classifier Fundamentals - PuppetConf 2014Puppet
 
Rapid scaling in_the_cloud_with_puppet
Rapid scaling in_the_cloud_with_puppetRapid scaling in_the_cloud_with_puppet
Rapid scaling in_the_cloud_with_puppetCarl Caum
 
Puppet Node Classifiers Talk - Patrick Buckley
Puppet Node Classifiers Talk - Patrick BuckleyPuppet Node Classifiers Talk - Patrick Buckley
Puppet Node Classifiers Talk - Patrick BuckleyChristian Mague
 
Puppet and the Model-Driven Infrastructure
Puppet and the Model-Driven InfrastructurePuppet and the Model-Driven Infrastructure
Puppet and the Model-Driven Infrastructurelkanies
 
SCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scalingSCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scalingStanislav Osipov
 

Andere mochten auch (6)

Automating Node Classification
Automating Node ClassificationAutomating Node Classification
Automating Node Classification
 
Node Classifier Fundamentals - PuppetConf 2014
Node Classifier Fundamentals - PuppetConf 2014Node Classifier Fundamentals - PuppetConf 2014
Node Classifier Fundamentals - PuppetConf 2014
 
Rapid scaling in_the_cloud_with_puppet
Rapid scaling in_the_cloud_with_puppetRapid scaling in_the_cloud_with_puppet
Rapid scaling in_the_cloud_with_puppet
 
Puppet Node Classifiers Talk - Patrick Buckley
Puppet Node Classifiers Talk - Patrick BuckleyPuppet Node Classifiers Talk - Patrick Buckley
Puppet Node Classifiers Talk - Patrick Buckley
 
Puppet and the Model-Driven Infrastructure
Puppet and the Model-Driven InfrastructurePuppet and the Model-Driven Infrastructure
Puppet and the Model-Driven Infrastructure
 
SCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scalingSCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scaling
 

Ähnlich wie The Grand Puppet Sub-Systems Tour - Nicholas Fagerlund, Puppet Labs

Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014Puppet
 
Puppet getting started by Dirk Götz
Puppet getting started by Dirk GötzPuppet getting started by Dirk Götz
Puppet getting started by Dirk GötzNETWAYS
 
Can you upgrade to Puppet 4.x?
Can you upgrade to Puppet 4.x?Can you upgrade to Puppet 4.x?
Can you upgrade to Puppet 4.x?Martin Alfke
 
Strategies for Puppet code upgrade and refactoring
Strategies for Puppet code upgrade and refactoringStrategies for Puppet code upgrade and refactoring
Strategies for Puppet code upgrade and refactoringAlessandro Franceschi
 
DevOps Hackathon: Session 3 - Test Driven Infrastructure
DevOps Hackathon: Session 3 - Test Driven InfrastructureDevOps Hackathon: Session 3 - Test Driven Infrastructure
DevOps Hackathon: Session 3 - Test Driven InfrastructureAntons Kranga
 
Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php PresentationAlan Pinstein
 
Puppet Camp Duesseldorf 2014: Martin Alfke - Can you upgrade to puppet 4.x?
Puppet Camp Duesseldorf 2014: Martin Alfke - Can you upgrade to puppet 4.x?Puppet Camp Duesseldorf 2014: Martin Alfke - Can you upgrade to puppet 4.x?
Puppet Camp Duesseldorf 2014: Martin Alfke - Can you upgrade to puppet 4.x?NETWAYS
 
Puppet Troubleshooting
Puppet TroubleshootingPuppet Troubleshooting
Puppet TroubleshootingPuppet
 
Bangpypers april-meetup-2012
Bangpypers april-meetup-2012Bangpypers april-meetup-2012
Bangpypers april-meetup-2012Deepak Garg
 
Loops and Unicorns - The Future of the Puppet Language - PuppetConf 2013
Loops and Unicorns - The Future of the Puppet Language - PuppetConf 2013Loops and Unicorns - The Future of the Puppet Language - PuppetConf 2013
Loops and Unicorns - The Future of the Puppet Language - PuppetConf 2013Puppet
 
Building Cloud Castles
Building Cloud CastlesBuilding Cloud Castles
Building Cloud CastlesBen Scofield
 
Oliver hookins puppetcamp2011
Oliver hookins puppetcamp2011Oliver hookins puppetcamp2011
Oliver hookins puppetcamp2011Puppet
 
Our Puppet Story (GUUG FFG 2015)
Our Puppet Story (GUUG FFG 2015)Our Puppet Story (GUUG FFG 2015)
Our Puppet Story (GUUG FFG 2015)DECK36
 
Puppet at Bazaarvoice
Puppet at BazaarvoicePuppet at Bazaarvoice
Puppet at BazaarvoicePuppet
 
Orchestrated Functional Testing with Puppet-spec and Mspectator
Orchestrated Functional Testing with Puppet-spec and MspectatorOrchestrated Functional Testing with Puppet-spec and Mspectator
Orchestrated Functional Testing with Puppet-spec and MspectatorRaphaël PINSON
 
Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)Soshi Nemoto
 
Puppet atbazaarvoice
Puppet atbazaarvoicePuppet atbazaarvoice
Puppet atbazaarvoiceDave Barcelo
 

Ähnlich wie The Grand Puppet Sub-Systems Tour - Nicholas Fagerlund, Puppet Labs (20)

Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
 
Puppi. Puppet strings to the shell
Puppi. Puppet strings to the shellPuppi. Puppet strings to the shell
Puppi. Puppet strings to the shell
 
Puppet getting started by Dirk Götz
Puppet getting started by Dirk GötzPuppet getting started by Dirk Götz
Puppet getting started by Dirk Götz
 
Can you upgrade to Puppet 4.x?
Can you upgrade to Puppet 4.x?Can you upgrade to Puppet 4.x?
Can you upgrade to Puppet 4.x?
 
Strategies for Puppet code upgrade and refactoring
Strategies for Puppet code upgrade and refactoringStrategies for Puppet code upgrade and refactoring
Strategies for Puppet code upgrade and refactoring
 
DevOps Hackathon: Session 3 - Test Driven Infrastructure
DevOps Hackathon: Session 3 - Test Driven InfrastructureDevOps Hackathon: Session 3 - Test Driven Infrastructure
DevOps Hackathon: Session 3 - Test Driven Infrastructure
 
Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php Presentation
 
Puppet Camp Duesseldorf 2014: Martin Alfke - Can you upgrade to puppet 4.x?
Puppet Camp Duesseldorf 2014: Martin Alfke - Can you upgrade to puppet 4.x?Puppet Camp Duesseldorf 2014: Martin Alfke - Can you upgrade to puppet 4.x?
Puppet Camp Duesseldorf 2014: Martin Alfke - Can you upgrade to puppet 4.x?
 
Puppet Troubleshooting
Puppet TroubleshootingPuppet Troubleshooting
Puppet Troubleshooting
 
Bangpypers april-meetup-2012
Bangpypers april-meetup-2012Bangpypers april-meetup-2012
Bangpypers april-meetup-2012
 
Intro to-puppet
Intro to-puppetIntro to-puppet
Intro to-puppet
 
Loops and Unicorns - The Future of the Puppet Language - PuppetConf 2013
Loops and Unicorns - The Future of the Puppet Language - PuppetConf 2013Loops and Unicorns - The Future of the Puppet Language - PuppetConf 2013
Loops and Unicorns - The Future of the Puppet Language - PuppetConf 2013
 
Catalyst MVC
Catalyst MVCCatalyst MVC
Catalyst MVC
 
Building Cloud Castles
Building Cloud CastlesBuilding Cloud Castles
Building Cloud Castles
 
Oliver hookins puppetcamp2011
Oliver hookins puppetcamp2011Oliver hookins puppetcamp2011
Oliver hookins puppetcamp2011
 
Our Puppet Story (GUUG FFG 2015)
Our Puppet Story (GUUG FFG 2015)Our Puppet Story (GUUG FFG 2015)
Our Puppet Story (GUUG FFG 2015)
 
Puppet at Bazaarvoice
Puppet at BazaarvoicePuppet at Bazaarvoice
Puppet at Bazaarvoice
 
Orchestrated Functional Testing with Puppet-spec and Mspectator
Orchestrated Functional Testing with Puppet-spec and MspectatorOrchestrated Functional Testing with Puppet-spec and Mspectator
Orchestrated Functional Testing with Puppet-spec and Mspectator
 
Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)Fabric workshop(1) - (MOSG)
Fabric workshop(1) - (MOSG)
 
Puppet atbazaarvoice
Puppet atbazaarvoicePuppet atbazaarvoice
Puppet atbazaarvoice
 

Mehr von Puppet

Puppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepoPuppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepoPuppet
 
Puppetcamp r10kyaml
Puppetcamp r10kyamlPuppetcamp r10kyaml
Puppetcamp r10kyamlPuppet
 
2021 04-15 operational verification (with notes)
2021 04-15 operational verification (with notes)2021 04-15 operational verification (with notes)
2021 04-15 operational verification (with notes)Puppet
 
Puppet camp vscode
Puppet camp vscodePuppet camp vscode
Puppet camp vscodePuppet
 
Modules of the twenties
Modules of the twentiesModules of the twenties
Modules of the twentiesPuppet
 
Applying Roles and Profiles method to compliance code
Applying Roles and Profiles method to compliance codeApplying Roles and Profiles method to compliance code
Applying Roles and Profiles method to compliance codePuppet
 
KGI compliance as-code approach
KGI compliance as-code approachKGI compliance as-code approach
KGI compliance as-code approachPuppet
 
Enforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automationEnforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automationPuppet
 
Keynote: Puppet camp compliance
Keynote: Puppet camp complianceKeynote: Puppet camp compliance
Keynote: Puppet camp compliancePuppet
 
Automating it management with Puppet + ServiceNow
Automating it management with Puppet + ServiceNowAutomating it management with Puppet + ServiceNow
Automating it management with Puppet + ServiceNowPuppet
 
Puppet: The best way to harden Windows
Puppet: The best way to harden WindowsPuppet: The best way to harden Windows
Puppet: The best way to harden WindowsPuppet
 
Simplified Patch Management with Puppet - Oct. 2020
Simplified Patch Management with Puppet - Oct. 2020Simplified Patch Management with Puppet - Oct. 2020
Simplified Patch Management with Puppet - Oct. 2020Puppet
 
Accelerating azure adoption with puppet
Accelerating azure adoption with puppetAccelerating azure adoption with puppet
Accelerating azure adoption with puppetPuppet
 
Puppet catalog Diff; Raphael Pinson
Puppet catalog Diff; Raphael PinsonPuppet catalog Diff; Raphael Pinson
Puppet catalog Diff; Raphael PinsonPuppet
 
ServiceNow and Puppet- better together, Kevin Reeuwijk
ServiceNow and Puppet- better together, Kevin ReeuwijkServiceNow and Puppet- better together, Kevin Reeuwijk
ServiceNow and Puppet- better together, Kevin ReeuwijkPuppet
 
Take control of your dev ops dumping ground
Take control of your  dev ops dumping groundTake control of your  dev ops dumping ground
Take control of your dev ops dumping groundPuppet
 
100% Puppet Cloud Deployment of Legacy Software
100% Puppet Cloud Deployment of Legacy Software100% Puppet Cloud Deployment of Legacy Software
100% Puppet Cloud Deployment of Legacy SoftwarePuppet
 
Puppet User Group
Puppet User GroupPuppet User Group
Puppet User GroupPuppet
 
Continuous Compliance and DevSecOps
Continuous Compliance and DevSecOpsContinuous Compliance and DevSecOps
Continuous Compliance and DevSecOpsPuppet
 
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick MaludyThe Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick MaludyPuppet
 

Mehr von Puppet (20)

Puppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepoPuppet camp2021 testing modules and controlrepo
Puppet camp2021 testing modules and controlrepo
 
Puppetcamp r10kyaml
Puppetcamp r10kyamlPuppetcamp r10kyaml
Puppetcamp r10kyaml
 
2021 04-15 operational verification (with notes)
2021 04-15 operational verification (with notes)2021 04-15 operational verification (with notes)
2021 04-15 operational verification (with notes)
 
Puppet camp vscode
Puppet camp vscodePuppet camp vscode
Puppet camp vscode
 
Modules of the twenties
Modules of the twentiesModules of the twenties
Modules of the twenties
 
Applying Roles and Profiles method to compliance code
Applying Roles and Profiles method to compliance codeApplying Roles and Profiles method to compliance code
Applying Roles and Profiles method to compliance code
 
KGI compliance as-code approach
KGI compliance as-code approachKGI compliance as-code approach
KGI compliance as-code approach
 
Enforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automationEnforce compliance policy with model-driven automation
Enforce compliance policy with model-driven automation
 
Keynote: Puppet camp compliance
Keynote: Puppet camp complianceKeynote: Puppet camp compliance
Keynote: Puppet camp compliance
 
Automating it management with Puppet + ServiceNow
Automating it management with Puppet + ServiceNowAutomating it management with Puppet + ServiceNow
Automating it management with Puppet + ServiceNow
 
Puppet: The best way to harden Windows
Puppet: The best way to harden WindowsPuppet: The best way to harden Windows
Puppet: The best way to harden Windows
 
Simplified Patch Management with Puppet - Oct. 2020
Simplified Patch Management with Puppet - Oct. 2020Simplified Patch Management with Puppet - Oct. 2020
Simplified Patch Management with Puppet - Oct. 2020
 
Accelerating azure adoption with puppet
Accelerating azure adoption with puppetAccelerating azure adoption with puppet
Accelerating azure adoption with puppet
 
Puppet catalog Diff; Raphael Pinson
Puppet catalog Diff; Raphael PinsonPuppet catalog Diff; Raphael Pinson
Puppet catalog Diff; Raphael Pinson
 
ServiceNow and Puppet- better together, Kevin Reeuwijk
ServiceNow and Puppet- better together, Kevin ReeuwijkServiceNow and Puppet- better together, Kevin Reeuwijk
ServiceNow and Puppet- better together, Kevin Reeuwijk
 
Take control of your dev ops dumping ground
Take control of your  dev ops dumping groundTake control of your  dev ops dumping ground
Take control of your dev ops dumping ground
 
100% Puppet Cloud Deployment of Legacy Software
100% Puppet Cloud Deployment of Legacy Software100% Puppet Cloud Deployment of Legacy Software
100% Puppet Cloud Deployment of Legacy Software
 
Puppet User Group
Puppet User GroupPuppet User Group
Puppet User Group
 
Continuous Compliance and DevSecOps
Continuous Compliance and DevSecOpsContinuous Compliance and DevSecOps
Continuous Compliance and DevSecOps
 
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick MaludyThe Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
The Dynamic Duo of Puppet and Vault tame SSL Certificates, Nick Maludy
 

Kürzlich hochgeladen

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 

Kürzlich hochgeladen (20)

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

The Grand Puppet Sub-Systems Tour - Nicholas Fagerlund, Puppet Labs

  • 1. 2014 Presented by The Grand Puppet Sub-Systems Tour Nick Fagerlund Technical Writer / Weird Bugs | Puppet Labs @nfagerlund
  • 3. Presented by What does Puppet DO? • Gather system information • Compile a catalog • Apply catalog • Report
  • 4. Presented by What does Puppet DO? AGENT • Gather system information • Apply catalog • Report MASTER • Compile a catalog
  • 5. STOP 1: Command Line and the Presented by
  • 6. Presented by Someone ran puppet agent
  • 7. Presented by ??? • /opt/puppet/bin/puppet • Puppet::Util::CommandLine.new.execute • Puppet::Application.find • Puppet::Application::Agent.new • Puppet::Application::Agent#setup • Puppet::Application::Agent#run_command
  • 8. Presented by #run_command # lib/puppet/application/agent.rb def run_command if options[:fingerprint] fingerprint else # It'd be nice to daemonize later, but we have to daemonize before # waiting for certificates so that we don't block daemon = daemonize_process_when(Puppet[:daemonize]) ! wait_for_certificates ! if Puppet[:onetime] onetime(daemon) else main(daemon) end
  • 9. Presented by onetime() and main() # lib/puppet/application/agent.rb begin exitstatus = daemon.agent.run rescue => detail Puppet.log_exception(detail) end ! daemon.stop(:exit => false) ! if not exitstatus exit(1) elsif options[:detailed_exitcodes] then exit(exitstatus) else exit(0) end # lib/puppet/application/agent.rb def main(daemon) if Puppet[:listen] setup_listen(daemon) end Puppet.notice "Starting Puppet client version #{Puppet.version}" ! daemon.start end
  • 10. Presented by Obtaining the daemon # lib/puppet/application/agent.rb def daemonize_process_when(should_daemonize) daemon = Puppet::Daemon.new(Puppet::Util::Pidlock.new(Puppet[:pidfile])) daemon.argv = @argv daemon.agent = @agent ! daemon.daemonize if should_daemonize ! daemon end
  • 11. STOP 2: The Daemon and the Presented by
  • 12. Presented by DAEMON LAND?! Nope Bye
  • 13. Presented by Puppet::Agent • Run a thing
  • 14. Presented by Puppet::Daemon • Run a thing that runs the other thing
  • 15. Lots of layers of abstraction?? • Historical reasons! Presented by
  • 16. Presented by STOP 3: The Configurer
  • 18. Puppet::Configurer#run_internal Presented by # lib/puppet/configurer.rb def run_internal(options) # We create the report pre-­‐populated with default settings for # environment and transaction_uuid very early, this is to ensure # they are sent regardless of any catalog compilation failures or # exceptions. options[:report] ||= Puppet::Transaction::Report.new("apply", nil, @environment, @transaction_uuid) report = options[:report] init_storage ! Puppet::Util::Log.newdestination(report) … … …
  • 19. Puppet::Configurer#run_internal Presented by # lib/puppet/configurer.rb … query_options = get_facts(options) unless query_options …
  • 20. Puppet::Configurer#run_internal Presented by # lib/puppet/configurer/fact_handler.rb … facts = Puppet::Node::Facts.indirection.find(Puppet[:node_name_value], :environment => @environment) …
  • 21. Puppet::Configurer#run_internal Presented by # lib/puppet/configurer.rb … unless catalog = prepare_and_retrieve_catalog(options, query_options) return nil end …
  • 22. Puppet::Configurer#run_internal Presented by # lib/puppet/configurer.rb … apply_catalog(catalog, options) …
  • 23. Presented by Where next? Retrieve Apply
  • 24. STOP 4: The Transaction Presented by
  • 26. Presented by Puppet::Resource::Catalog Catalog Resource Other Stuff
  • 27. Presented by Puppet::Configurer (again) # lib/puppet/configurer.rb def convert_catalog(result, duration) catalog = result.to_ral catalog.finalize catalog.retrieval_duration = duration catalog.write_class_file catalog.write_resource_file catalog end
  • 28. Presented by RAL Catalog
  • 29. Presented by RAL Catalog # lib/puppet/resource/catalog.rb def to_catalog(convert) result = self.class.new(self.name, self.environment_instance) result.version = self.version map = {} resources.each do |resource| next if virtual_not_exported?(resource) next if block_given? and yield resource newres = resource.copy_as_resource newres.catalog = result if convert != :to_resource newres = newres.to_ral end # We can't guarantee that resources don't munge their names # (like files do with trailing slashes), so we have to keep track # of what a resource got converted to. map[resource.ref] = newres result.add_resource newres end
  • 30. Presented by RAL Catalog Puppet::Resource ! ↓ ! (something) << Puppet::Type
  • 31. Presented by RAL Catalog ???
  • 32. Presented by RAL Catalog # lib/puppet/configurer.rb def apply_catalog(catalog, options) report = options[:report] report.configuration_version = catalog.version ! benchmark(:notice, "Finished catalog run") do catalog.apply(options) end ! report.finalize_report report end
  • 33. Puppet::Resource::Catalog#apply Presented by # lib/puppet/resource/catalog.rb def apply(options = {}) Puppet::Util::Storage.load if host_config? ! transaction = create_transaction(options) ! begin transaction.report.as_logging_destination do transaction.evaluate end rescue Puppet::Error => detail !
  • 35. Presented by Transaction • Ral catalog • Prioritizer • Report
  • 36. Presented by Transaction • Ral catalog • Prioritizer • Report • Event manager • Resource harness • Relationship graph
  • 37. Presented by Transaction • Ral catalog • Prioritizer • Report • Event manager • Resource harness • Relationship graph • relationship_graph.traverse
  • 38. Presented by Transaction • Ral catalog • Prioritizer • Report • Event manager • Resource harness • Relationship graph • relationship_graph.traverse • *ollies out*
  • 39. Presented by STOP 5: The Indirector
  • 40. Presented by Back to Puppet::Configurer • #prepare_and_retrieve_catalog
  • 41. Presented by Back to Puppet::Configurer # lib/puppet/configurer.rb result = Puppet::Resource::Catalog.indirection.find( Puppet[:node_name_value], query_options.merge(:ignore_cache => true, :environment => @environment, :fail_on_404 => true) )
  • 42. Presented by The Indirector ! Puppet::Resource::Catalog.indirection.find()
  • 43. Presented by The Indirector ← ↑ ↓ ?
  • 44. Presented by The Indirector • Globally configured • Abstract • Gets stuff for you
  • 45. Presented by The Indirector # lib/puppet/resource/catalog.rb extend Puppet::Indirector indirects :catalog, :terminus_setting => :catalog_terminus
  • 46. Presented by The Indirector • find • search • save • destroy
  • 47. Presented by The Indirector • find • search • save • destroy • terminus_class • cache_class • lib/puppet/indirector/…
  • 48. Presented by Puppet Agent • Catalog => REST • Report => REST • Facts => Facter
  • 49. Presented by Puppet Apply • Catalog => Compiler • Report => Processor • Facts => Facter
  • 50. Presented by Avoiding the cache # lib/puppet/configurer.rb result = Puppet::Resource::Catalog.indirection.find( Puppet[:node_name_value], query_options.merge(:ignore_cache => true, :environment => @environment, :fail_on_404 => true) )
  • 51. Presented by The Indirector • Why?
  • 52. Presented by The Indirector • Why? • Global? Rigid?
  • 53. Presented by The Indirector • Why? • Global? Rigid? • IT MAKES SENSE IN CONTEXT
  • 54. Presented by The Indirector • …Catalog.find( <FACTS> ) • REST terminus • HTTP POST request to master
  • 55. STOP 6: The Puppet Master’s Presented by
  • 56. Presented by Rack Web server ↓ Rack server ↓ “App” object that responds to #call() ↓ Actual application logic
  • 57. Presented by config.ru $0 = "master" ! ARGV << "-­‐-­‐rack" ! ARGV << "-­‐-­‐confdir" << "/etc/puppet" ARGV << "-­‐-­‐vardir" << "/var/lib/puppet" ! require 'puppet/util/command_line' run Puppet::Util::CommandLine.new.execute !
  • 58. Presented by Starting master w/ Rack # lib/puppet/application/master.rb def start_rack_master require 'puppet/network/http/rack' ! announce_start_of_master ! return Puppet::Network::HTTP::Rack.new() end
  • 59. Presented by The app object # lib/puppet/network/http/rack.rb class Puppet::Network::HTTP::Rack def call(env) request = Rack::Request.new(env) response = Rack::Response.new Puppet.debug 'Handling request: %s %s' % [request.request_method, request.fullpath] ! begin Puppet::Network::HTTP::RackREST.new.process(request, response) rescue => detail # Send a Status 500 Error on unhandled exceptions. response.status = 500 response['Content-­‐Type'] = 'text/plain' response.write 'Internal Server Error: "%s"' % detail.message # log what happened Puppet.log_exception(detail, "Puppet Server (Rack): Internal Server Error: Unhandled Exception: "%s"" % detail.message) end response.finish
  • 60. Presented by #process # lib/puppet/network/http/handler.rb def process(request, response) new_response = Puppet::Network::HTTP::Response.new(self, response) ! request_headers = headers(request) request_params = params(request) request_method = http_method(request) request_path = path(request) … !
  • 61. Presented by #process # lib/puppet/network/http/handler.rb if route = @routes.find { |route| route.matches?(new_request) } route.process(new_request, new_response)
  • 63. lib/puppet/network/http/api/v1.rb • GET => indirection.find() • POST => indirection.find() (for catalogs) • (There was an issue with some servers rejecting GET parameters that were too long. Funny story about that.) • DELETE => indirection.destroy() • PUT => indirection.save() • GET to magical plural name => indirection.search() Presented by
  • 64. Presented by BIG PICTURE Configurer calls catalog.indirection.find() ↓ HTTP POST request to master ↓ Request handler calls catalog.indirection.find() ↓ Compiler terminus handles it ↓
  • 65. Presented by STOP 7: The Compiler
  • 66. Presented by MOSTLY SKIPPING THIS Lexer ↓ Parser ↓ AST ↓ Evaluator ↓
  • 67. Presented by THIS IS THE TEST “Compiler terminus to the catalog indirection” ! ???
  • 68. Presented by THIS IS THE TEST GOOD WORK EVERYBODY!
  • 70. Presented by THANKS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! •Hope we’ll see you next year in Portland!