SlideShare a Scribd company logo
1 of 42
Download to read offline
MCollective installed. And
now?
2013-28-11 | Puppet Camp Munich
SELF-INTRODUCTION
Just me: Thomas Gelf
Joined NETWAYS in 2010
Formerly more than 10 years:
Web (Application) Development
Routing/Switching (Bank- and ISP-Backbone)
ISP-Environment: architecturing and realizing highly available
plattforms (Mail, Hosting, SIP-Carrier, IPv6...)
Nationality: Italian. Mother tongue: German
SOUTH TYROLEAN!!!
DEVELOPERRRR!!! Since today :-)
Puppet and Netways

Puppet Labs Partner
Puppet Consulting
First provider of Puppet trainings in Germany
More: www.netways.de/training
What this talk is all about
MCollective
Quick introduction
Basic use cases
Architecture
Security
Extensions
Future ideas, suggestions
HANDS UP
INTRODUCTION
Facts about MCollective
Father: R.I.Pienaar
Age: 2.2.4 (2.3.3)
Language: Ruby
Profession: Orchestration framework
CV: http://puppetlabs.com/mcollective
MCollective components
It's soooo easy...
We send commands to a group of servers
They execute them and send replies
We need a middleware == black magic for lots of us
Honestly, there is more...
BASIC USE CASES
Use case I - Break the rules
It is "a puppet component" so we are allowed to use it
No more "defined state". Finally!
Use case II - puppet resource
puppet resource on steroids
Use case II - puppet resource
puppet resource on steroids
Conflicts with Puppet? Can be "solved":
plugin.puppet.resource_allow_managed_resources
Use case III - Emergency button
After rolling out new Puppet modules:
STOP all Puppet Agents
Find out what went wrong
Fix it. Somehow.
Use case III - Emergency button
If this is what you are usually doing...
...please. Please. PLEASE!!! have a look at
http://projects.puppetlabs.com/projects/1/wiki/Development_Writing_Tests
Use case IV - Archeology
How many different <SomeApplication> versions are in productional
use?
Is this you? Then it's time for a commercial break...
Puppet Enterprise
Use case V - Puppet health
It's great, but...
...do not forget about the colorful GUIs.
Reporting matters!
Use case VI - puppet kick
puppet kick replacement
mco
mco
mco
mco

service stop puppet
puppet runonce --batch 10 --batch-sleep 600
puppet runall 10
puppet (en|di)sable

Run on demand or triggered by centralized cronjob, Jenkins, GUI
(PE!)
Use case VI - puppet kick
You can combine this with ACLs
NOC: restart services in maintenance mode
Developers: everything. In THEIR environment.
Thomas: loves wildcards
"Action Policy Authorization Plugin"
Use case VII - for negative people
Double negative
I do not disagree
I haven't seen nothing
If you don't want to go nowhere...
Use case VII - for negative people
With Puppet, this is

--no-noop”
Use case VIII - Apply specific modules
mco puppet runonce --tag somespecialmodule
You should be VERY careful with tags!
Use case IX - CMDB grooming
YES, every change is processed in our CMDB
And then applied by Puppet
Or the other way round
mco inventory
factsource = facter
# VS
factsource = yaml
plugin.yaml = /etc/mcollective/facts.yaml

Report handler?
Use case X - manage certificates
We all love managing Puppet certificates
mco puppet resource exec 
'/bin/rm -rf $(puppet agent --configprint ssldir)/*'

Have a look at
plugin.puppet.resource_type_(black|white)list
WE SKIPPED SOME BASIC STUFF
Filters - simple ones
-F, --wf, --with-fact osfamily=Debian
-C, --wc, --with-class some::class
-W, --with customer=lovely my_roles::loadbalancer
Filters - oldschool
-A, --wa, --with-agent youragentplugin
-I, --wi, --with-identity certname

When delivering MCO config, do NOT trust facts
identity = <%= lookupvar('::certname') %>
Filters - the cool stuff
-S, --select FILTER
-S "resource('Service[apache2]').managed = true"
-S "fstat('/etc/hosts').md5=/^0c9d/ and environment=dev"
Based on data plugins
SECURITY
SECURITY MATTERS!
puppet module install puppetlabs-mcollective

They had a reason for writing this.
SECURITY MATTERS!
Please do not deploy without reading A LOT
No plaintext messages
No preshared keys
Re-use Puppet certs for the transport
Create one certificate per client to sign bodies
IT DOESN'T STOP HERE
Search for plugins!
Monitoring: replace nrpe
Manage your iptables rules "live"
Handle processes
Read about registration...
...unless your network is your only source of truth
Start writing simple RPC Agents - harmless
module MCollective
module Agent
class Helloworld<RPC::Agent
action 'echo' do
validate :msg, String
reply[:msg] = request[:msg]
end
end
end
end
Start writing simple RPC Agents - harmful
action 'exec' do
validate :msg, String
reply[:status] = run(
request[:command], :stdout => :out, :stderr => :err
)
reply[:stdout].chomp!
reply[:stderr].chomp!
end
action 'perlrulez' do
implemented_by "/some/script.pl"
end
http://docs.puppetlabs.com/mcollective/simplerpc/agents.html
Write SimpleRPC clients
require 'mcollective'
include MCollective::RPC
mc = rpcclient("helloworld")
mc.echo(:msg => "hello world").each do |resp|
printf("%-40s: %sn", resp[:sender], resp[:data][:msg])
end
This is where real orchestration starts
Bad news: you are on your own
LAB
Thank you for your attention!
Questions?

class puppetcamp {
package { 'questions':
ensure => answered
}
}

Thomas Gelf <thomas.gelf@netways.de>

More Related Content

Similar to MCollective installed. And now? by Thomas Gelf

Integrating cloud stack with puppet
Integrating cloud stack with puppetIntegrating cloud stack with puppet
Integrating cloud stack with puppetPuppet
 
Puppet for Sys Admins
Puppet for Sys AdminsPuppet for Sys Admins
Puppet for Sys AdminsPuppet
 
Puppet for SysAdmins
Puppet for SysAdminsPuppet for SysAdmins
Puppet for SysAdminsPuppet
 
Muduo network library
Muduo network libraryMuduo network library
Muduo network libraryShuo Chen
 
Getting Started with Pelican
Getting Started with PelicanGetting Started with Pelican
Getting Started with PelicanNazrul Kamaruddin
 
Puppet Camp Düsseldorf 2014: Puppet CA Certificates Explained
Puppet Camp Düsseldorf 2014: Puppet CA Certificates ExplainedPuppet Camp Düsseldorf 2014: Puppet CA Certificates Explained
Puppet Camp Düsseldorf 2014: Puppet CA Certificates ExplainedPuppet
 
Puppet Camp Duesseldorf 2014: Thomas Gelf - Puppet CA: certificates explained
Puppet Camp Duesseldorf 2014: Thomas Gelf - Puppet CA: certificates explainedPuppet Camp Duesseldorf 2014: Thomas Gelf - Puppet CA: certificates explained
Puppet Camp Duesseldorf 2014: Thomas Gelf - Puppet CA: certificates explainedNETWAYS
 
Tastypie: Easy APIs to Make Your Work Easier
Tastypie: Easy APIs to Make Your Work EasierTastypie: Easy APIs to Make Your Work Easier
Tastypie: Easy APIs to Make Your Work EasierHarvard Web Working Group
 
5 minute intro to virtualenv
5 minute intro to virtualenv5 minute intro to virtualenv
5 minute intro to virtualenvamenasse
 
Deployment with capifony
Deployment with capifonyDeployment with capifony
Deployment with capifonyJan De Coster
 
ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany
ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache TuscanyApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany
ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache TuscanyJean-Sebastien Delfino
 
Clash of the Titans: Releasing the Kraken | NodeJS @paypal
Clash of the Titans: Releasing the Kraken | NodeJS @paypalClash of the Titans: Releasing the Kraken | NodeJS @paypal
Clash of the Titans: Releasing the Kraken | NodeJS @paypalBill Scott
 
Puppet for dummies - PHPBenelux UG edition
Puppet for dummies - PHPBenelux UG editionPuppet for dummies - PHPBenelux UG edition
Puppet for dummies - PHPBenelux UG editionJoshua Thijssen
 
Perl Usage In Security and Penetration testing
Perl Usage In Security and Penetration testingPerl Usage In Security and Penetration testing
Perl Usage In Security and Penetration testingVlatko Kosturjak
 
Deploy Mediawiki Using FIWARE Lab Facilities
Deploy Mediawiki Using FIWARE Lab FacilitiesDeploy Mediawiki Using FIWARE Lab Facilities
Deploy Mediawiki Using FIWARE Lab FacilitiesFIWARE
 
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
 

Similar to MCollective installed. And now? by Thomas Gelf (20)

One-Man Ops
One-Man OpsOne-Man Ops
One-Man Ops
 
Mcollective introduction
Mcollective introductionMcollective introduction
Mcollective introduction
 
Integrating cloud stack with puppet
Integrating cloud stack with puppetIntegrating cloud stack with puppet
Integrating cloud stack with puppet
 
Puppet for Sys Admins
Puppet for Sys AdminsPuppet for Sys Admins
Puppet for Sys Admins
 
Puppet for SysAdmins
Puppet for SysAdminsPuppet for SysAdmins
Puppet for SysAdmins
 
Muduo network library
Muduo network libraryMuduo network library
Muduo network library
 
Getting Started with Pelican
Getting Started with PelicanGetting Started with Pelican
Getting Started with Pelican
 
Puppet Camp Düsseldorf 2014: Puppet CA Certificates Explained
Puppet Camp Düsseldorf 2014: Puppet CA Certificates ExplainedPuppet Camp Düsseldorf 2014: Puppet CA Certificates Explained
Puppet Camp Düsseldorf 2014: Puppet CA Certificates Explained
 
Puppet Camp Duesseldorf 2014: Thomas Gelf - Puppet CA: certificates explained
Puppet Camp Duesseldorf 2014: Thomas Gelf - Puppet CA: certificates explainedPuppet Camp Duesseldorf 2014: Thomas Gelf - Puppet CA: certificates explained
Puppet Camp Duesseldorf 2014: Thomas Gelf - Puppet CA: certificates explained
 
CloudInit Introduction
CloudInit IntroductionCloudInit Introduction
CloudInit Introduction
 
Tastypie: Easy APIs to Make Your Work Easier
Tastypie: Easy APIs to Make Your Work EasierTastypie: Easy APIs to Make Your Work Easier
Tastypie: Easy APIs to Make Your Work Easier
 
5 minute intro to virtualenv
5 minute intro to virtualenv5 minute intro to virtualenv
5 minute intro to virtualenv
 
Deployment with capifony
Deployment with capifonyDeployment with capifony
Deployment with capifony
 
ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany
ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache TuscanyApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany
ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany
 
Deploy MediaWiki usgin Fiware Lab Facilities
Deploy MediaWiki usgin Fiware Lab FacilitiesDeploy MediaWiki usgin Fiware Lab Facilities
Deploy MediaWiki usgin Fiware Lab Facilities
 
Clash of the Titans: Releasing the Kraken | NodeJS @paypal
Clash of the Titans: Releasing the Kraken | NodeJS @paypalClash of the Titans: Releasing the Kraken | NodeJS @paypal
Clash of the Titans: Releasing the Kraken | NodeJS @paypal
 
Puppet for dummies - PHPBenelux UG edition
Puppet for dummies - PHPBenelux UG editionPuppet for dummies - PHPBenelux UG edition
Puppet for dummies - PHPBenelux UG edition
 
Perl Usage In Security and Penetration testing
Perl Usage In Security and Penetration testingPerl Usage In Security and Penetration testing
Perl Usage In Security and Penetration testing
 
Deploy Mediawiki Using FIWARE Lab Facilities
Deploy Mediawiki Using FIWARE Lab FacilitiesDeploy Mediawiki Using FIWARE Lab Facilities
Deploy Mediawiki Using FIWARE Lab Facilities
 
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
 

Recently uploaded

MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 

Recently uploaded (20)

MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
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...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 

MCollective installed. And now? by Thomas Gelf

  • 3. Just me: Thomas Gelf Joined NETWAYS in 2010 Formerly more than 10 years: Web (Application) Development Routing/Switching (Bank- and ISP-Backbone) ISP-Environment: architecturing and realizing highly available plattforms (Mail, Hosting, SIP-Carrier, IPv6...) Nationality: Italian. Mother tongue: German SOUTH TYROLEAN!!!
  • 5. Puppet and Netways Puppet Labs Partner Puppet Consulting First provider of Puppet trainings in Germany More: www.netways.de/training
  • 6. What this talk is all about MCollective Quick introduction Basic use cases Architecture Security Extensions Future ideas, suggestions
  • 9. Facts about MCollective Father: R.I.Pienaar Age: 2.2.4 (2.3.3) Language: Ruby Profession: Orchestration framework CV: http://puppetlabs.com/mcollective
  • 10. MCollective components It's soooo easy... We send commands to a group of servers They execute them and send replies We need a middleware == black magic for lots of us Honestly, there is more...
  • 12. Use case I - Break the rules It is "a puppet component" so we are allowed to use it No more "defined state". Finally!
  • 13. Use case II - puppet resource puppet resource on steroids
  • 14. Use case II - puppet resource puppet resource on steroids Conflicts with Puppet? Can be "solved": plugin.puppet.resource_allow_managed_resources
  • 15. Use case III - Emergency button After rolling out new Puppet modules: STOP all Puppet Agents Find out what went wrong Fix it. Somehow.
  • 16. Use case III - Emergency button If this is what you are usually doing... ...please. Please. PLEASE!!! have a look at http://projects.puppetlabs.com/projects/1/wiki/Development_Writing_Tests
  • 17. Use case IV - Archeology How many different <SomeApplication> versions are in productional use? Is this you? Then it's time for a commercial break...
  • 19. Use case V - Puppet health It's great, but... ...do not forget about the colorful GUIs. Reporting matters!
  • 20. Use case VI - puppet kick puppet kick replacement mco mco mco mco service stop puppet puppet runonce --batch 10 --batch-sleep 600 puppet runall 10 puppet (en|di)sable Run on demand or triggered by centralized cronjob, Jenkins, GUI (PE!)
  • 21. Use case VI - puppet kick You can combine this with ACLs NOC: restart services in maintenance mode Developers: everything. In THEIR environment. Thomas: loves wildcards "Action Policy Authorization Plugin"
  • 22. Use case VII - for negative people Double negative I do not disagree I haven't seen nothing If you don't want to go nowhere...
  • 23. Use case VII - for negative people With Puppet, this is --no-noop”
  • 24. Use case VIII - Apply specific modules mco puppet runonce --tag somespecialmodule You should be VERY careful with tags!
  • 25. Use case IX - CMDB grooming YES, every change is processed in our CMDB And then applied by Puppet Or the other way round mco inventory factsource = facter # VS factsource = yaml plugin.yaml = /etc/mcollective/facts.yaml Report handler?
  • 26. Use case X - manage certificates We all love managing Puppet certificates mco puppet resource exec '/bin/rm -rf $(puppet agent --configprint ssldir)/*' Have a look at plugin.puppet.resource_type_(black|white)list
  • 27. WE SKIPPED SOME BASIC STUFF
  • 28. Filters - simple ones -F, --wf, --with-fact osfamily=Debian -C, --wc, --with-class some::class -W, --with customer=lovely my_roles::loadbalancer
  • 29. Filters - oldschool -A, --wa, --with-agent youragentplugin -I, --wi, --with-identity certname When delivering MCO config, do NOT trust facts identity = <%= lookupvar('::certname') %>
  • 30. Filters - the cool stuff -S, --select FILTER -S "resource('Service[apache2]').managed = true" -S "fstat('/etc/hosts').md5=/^0c9d/ and environment=dev" Based on data plugins
  • 32. SECURITY MATTERS! puppet module install puppetlabs-mcollective They had a reason for writing this.
  • 33. SECURITY MATTERS! Please do not deploy without reading A LOT No plaintext messages No preshared keys Re-use Puppet certs for the transport Create one certificate per client to sign bodies
  • 35. Search for plugins! Monitoring: replace nrpe Manage your iptables rules "live" Handle processes
  • 36. Read about registration... ...unless your network is your only source of truth
  • 37. Start writing simple RPC Agents - harmless module MCollective module Agent class Helloworld<RPC::Agent action 'echo' do validate :msg, String reply[:msg] = request[:msg] end end end end
  • 38. Start writing simple RPC Agents - harmful action 'exec' do validate :msg, String reply[:status] = run( request[:command], :stdout => :out, :stderr => :err ) reply[:stdout].chomp! reply[:stderr].chomp! end action 'perlrulez' do implemented_by "/some/script.pl" end http://docs.puppetlabs.com/mcollective/simplerpc/agents.html
  • 39. Write SimpleRPC clients require 'mcollective' include MCollective::RPC mc = rpcclient("helloworld") mc.echo(:msg => "hello world").each do |resp| printf("%-40s: %sn", resp[:sender], resp[:data][:msg]) end This is where real orchestration starts Bad news: you are on your own
  • 40. LAB
  • 41. Thank you for your attention!
  • 42. Questions? class puppetcamp { package { 'questions': ensure => answered } } Thomas Gelf <thomas.gelf@netways.de>