mcollective -...
TRANSCRIPT
![Page 1: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/1.jpg)
MCollectiveResistance is Futile…and stuff.
Gary LarizzaPuppet Labs@glarizza
![Page 2: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/2.jpg)
Just Do It.
![Page 3: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/3.jpg)
Just thesemachines
![Page 4: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/4.jpg)
Tell meabout it
![Page 5: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/5.jpg)
Don’t takeforever
![Page 6: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/6.jpg)
MCollective?
• Framework for System Management
•Orchestration
![Page 7: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/7.jpg)
MCollective?
• Framework for System Management
•Orchestration
![Page 8: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/8.jpg)
What Problems Does This Solve?
• System discovery
• Task execution
• Inventory/Data collection
• Configuration/Package management steroids
![Page 9: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/9.jpg)
![Page 10: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/10.jpg)
“MCollective is like a chainsaw, taped to a chainsaw, swinging in the air.”
![Page 11: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/11.jpg)
![Page 13: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/13.jpg)
WHY MCollective?
•No centralized inventory
• Thousands of Nodes
• Framework for Creation
![Page 14: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/14.jpg)
Many Servers - One Client
• Servers: PROVIDE data
• Client: RECEIVES information/data
![Page 15: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/15.jpg)
The Big Black Box?Message Queue
MCollective
MiddlewareBroker
Topic
CollectiveAgent
Client
Server
RPC
![Page 16: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/16.jpg)
The Big Black Box?
![Page 17: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/17.jpg)
The Big Black Box?• Sender/Receiver
•Request (The Message)
•Message Transfer
•Response (Also A Message)
![Page 18: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/18.jpg)
How Does it Work?(in the simplest fashion ever, please)
![Page 19: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/19.jpg)
Collective
Message Queue
‘client’
‘servers’
![Page 20: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/20.jpg)
Collective
mco ping --with-fact sevenofnine=true
Message Queue
‘client’
‘servers’
![Page 21: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/21.jpg)
Collective
mco ping --with-fact sevenofnine=true
Message Queue
‘client’
‘servers’
![Page 22: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/22.jpg)
Collective
mco ping --with-fact sevenofnine=true
Message Queue
‘client’
‘servers’
![Page 23: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/23.jpg)
Collective
mco ping --with-fact sevenofnine=true
Message Queue
‘client’
‘servers’
![Page 24: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/24.jpg)
Collective
mco ping --with-fact sevenofnine=true
Message Queue
‘client’
‘servers’
![Page 25: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/25.jpg)
Middleware?• The Software that handles
communication between services.
• The SERVICE that transfers the ‘request’ and the ‘response’.
• No logic ITSELF - like TCP/IP
![Page 26: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/26.jpg)
What’s a Message Queue?
• Data store that applications can write-to or read-from.
• SMTP Analogy: Like the mail queue on your smtp server.
• The individual chat room in the IRC analogy.
We’re British; we queue!
![Page 27: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/27.jpg)
Agents?• File containing Actions
•Actions = commands to execute
• Filtering for free
home$ rm -Rf /
![Page 28: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/28.jpg)
Agents:Simple (as) RPC
• ‘SimpleRPC’ is the framework we use for creating agents
• Abstracts common/difficult tasks (discovery, filtering)
• Agents written in Ruby
• Shell-out for exection
![Page 29: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/29.jpg)
Simple Agent
Printer
'list' lpstat -a | cut -d ' ' -f 1
module MCollective module Agent class Printer<RPC::Agent metadata :name => 'printer', :description => 'Printers and printing', :author => 'Gary Larizza', :license => 'BSD', :version => '0.1', :url =>'http://puppetlabs.com', :timeout => 100
action 'list' do reply[:output] = `lpstat -a | cut -d ' ' -f 1`.split end end endend
![Page 30: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/30.jpg)
Simple Agent
Printer
'list' lpstat -a | cut -d ' ' -f 1
module MCollective module Agent class Printer<RPC::Agent metadata :name => 'printer', :description => 'Printers and printing', :author => 'Gary Larizza', :license => 'BSD', :version => '0.1', :url =>'http://puppetlabs.com', :timeout => 100
action 'list' do reply[:output] = `lpstat -a | cut -d ' ' -f 1`.split end end endend
![Page 31: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/31.jpg)
Simple Agent
Printer
'list' lpstat -a | cut -d ' ' -f 1
module MCollective module Agent class Printer<RPC::Agent metadata :name => 'printer', :description => 'Printers and printing', :author => 'Gary Larizza', :license => 'BSD', :version => '0.1', :url =>'http://puppetlabs.com', :timeout => 100
action 'list' do reply[:output] = `lpstat -a | cut -d ' ' -f 1`.split end end endend
![Page 32: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/32.jpg)
Simple Agent
Printer
'list' lpstat -a | cut -d ' ' -f 1
module MCollective module Agent class Printer<RPC::Agent metadata :name => 'printer', :description => 'Printers and printing', :author => 'Gary Larizza', :license => 'BSD', :version => '0.1', :url =>'http://puppetlabs.com', :timeout => 100
action 'list' do reply[:output] = `lpstat -a | cut -d ' ' -f 1`.split end end endend
![Page 33: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/33.jpg)
Simple Agent
Printer
'list' lpstat -a | cut -d ' ' -f 1
module MCollective module Agent class Printer<RPC::Agent metadata :name => 'printer', :description => 'Printers and printing', :author => 'Gary Larizza', :license => 'BSD', :version => '0.1', :url =>'http://puppetlabs.com', :timeout => 100
action 'list' do reply[:output] = `lpstat -a | cut -d ' ' -f 1`.split end end endend
Agent Name
![Page 34: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/34.jpg)
Simple Agent
Printer
'list' lpstat -a | cut -d ' ' -f 1
module MCollective module Agent class Printer<RPC::Agent metadata :name => 'printer', :description => 'Printers and printing', :author => 'Gary Larizza', :license => 'BSD', :version => '0.1', :url =>'http://puppetlabs.com', :timeout => 100
action 'list' do reply[:output] = `lpstat -a | cut -d ' ' -f 1`.split end end endend
Agent Name
Action Name
![Page 35: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/35.jpg)
Simple Agent
Printer
'list' lpstat -a | cut -d ' ' -f 1
module MCollective module Agent class Printer<RPC::Agent metadata :name => 'printer', :description => 'Printers and printing', :author => 'Gary Larizza', :license => 'BSD', :version => '0.1', :url =>'http://puppetlabs.com', :timeout => 100
action 'list' do reply[:output] = `lpstat -a | cut -d ' ' -f 1`.split end end endend
Command to be Run
Agent Name
Action Name
![Page 36: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/36.jpg)
Simple Agent
Printer
'list' lpstat -a | cut -d ' ' -f 1
module MCollective module Agent class Printer<RPC::Agent metadata :name => 'printer', :description => 'Printers and printing', :author => 'Gary Larizza', :license => 'BSD', :version => '0.1', :url =>'http://puppetlabs.com', :timeout => 100
action 'list' do reply[:output] = `lpstat -a | cut -d ' ' -f 1`.split end end endend
![Page 37: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/37.jpg)
Running an Agentmco rpc printer list --with-fact location=HHS
Agent Name
Action Name
Filter
Fact Filter
![Page 38: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/38.jpg)
MCollective Agents vs ARD?
• Node Discovery
• Node Selection/Filtering
• Command Execution
• Input Parsing
• Timeouts and Blocking
![Page 39: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/39.jpg)
Plug-able and Customizable!• Plugins:
• Custom Agents
• Security
• Facts
• MCollective is a framework on which we’ve shipped a set of rudimentary programs.
![Page 40: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/40.jpg)
Let’s do this thing...
![Page 41: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/41.jpg)
Getting MCollective for Mac?
• bldmacpkg script in the ext/osx directory in MCollective Source
• https://github.com/unixorn/luggage-examples/tree/master/mcollective
•http://bit.ly/mc-4-mac
![Page 42: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/42.jpg)
Getting Puppet for Mac?
http://bit.ly/puppet-mac
![Page 43: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/43.jpg)
Custom Agents
http://bit.ly/munki-agent
![Page 44: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/44.jpg)
Install Puppet Enterprise
http://bit.ly/pe-install
![Page 45: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/45.jpg)
Code Used in Demo
http://bit.ly/mac-module
![Page 46: MCollective - documentation2.macsysadmin.sedocumentation2.macsysadmin.se/2012/pdf/Mcollective-Macsysadmi…MCollective Resistance is Futile…and stuff. Gary Larizza Puppet Labs @glarizza](https://reader031.vdocument.in/reader031/viewer/2022022501/5aa739437f8b9a54748bc4ef/html5/thumbnails/46.jpg)
• @glarizza
• glarizza on freenode
• (hint - my name doesn’t rhyme with pizza)