+ All Categories
Home > Technology > Intro to Using MCollective - PuppetConf 2014

Intro to Using MCollective - PuppetConf 2014

Date post: 25-Dec-2014
Category:
Upload: puppet-labs
View: 480 times
Download: 0 times
Share this document with a friend
Description:
Intro to Using MCollective - Devon Peters, Jive Software
37
Intro to MCollec,ve
Transcript
Page 1: Intro to Using MCollective - PuppetConf 2014

Intro  to  MCollec,ve    

Page 2: Intro to Using MCollective - PuppetConf 2014

Orchestra,on?  

Page 3: Intro to Using MCollective - PuppetConf 2014
Page 4: Intro to Using MCollective - PuppetConf 2014

h3ps://flic.kr/p/g5Z5TU  

Page 5: Intro to Using MCollective - PuppetConf 2014

Who  am  I?  

Page 6: Intro to Using MCollective - PuppetConf 2014
Page 7: Intro to Using MCollective - PuppetConf 2014
Page 8: Intro to Using MCollective - PuppetConf 2014
Page 9: Intro to Using MCollective - PuppetConf 2014
Page 10: Intro to Using MCollective - PuppetConf 2014
Page 11: Intro to Using MCollective - PuppetConf 2014
Page 12: Intro to Using MCollective - PuppetConf 2014
Page 13: Intro to Using MCollective - PuppetConf 2014
Page 14: Intro to Using MCollective - PuppetConf 2014
Page 15: Intro to Using MCollective - PuppetConf 2014

h3ps://flic.kr/p/5F1BfM  

Page 16: Intro to Using MCollective - PuppetConf 2014

h3ps://flic.kr/p/3t5WV  

Page 17: Intro to Using MCollective - PuppetConf 2014

h3ps://flic.kr/p/6rTurs  

Page 18: Intro to Using MCollective - PuppetConf 2014

h3ps://flic.kr/p/nvAJDP  

Page 19: Intro to Using MCollective - PuppetConf 2014
Page 20: Intro to Using MCollective - PuppetConf 2014
Page 21: Intro to Using MCollective - PuppetConf 2014

Agents  ==  Sheet  Music  

Page 22: Intro to Using MCollective - PuppetConf 2014

h3ps://flic.kr/p/4oxUMc  

Page 23: Intro to Using MCollective - PuppetConf 2014

"SchaRerdeInKoeln"  by  Túrelio  -­‐  Own  work.  Licensed  under  Crea,ve  Commons  A3ribu,on-­‐Share  Alike  2.5  via  Wikimedia  Commons  -­‐  h3p://commons.wikimedia.org/wiki/File:SchaRerdeInKoeln.jpg#mediaviewer/File:SchaRerdeInKoeln.jpg  

Page 24: Intro to Using MCollective - PuppetConf 2014
Page 25: Intro to Using MCollective - PuppetConf 2014
Page 26: Intro to Using MCollective - PuppetConf 2014

h3ps://flic.kr/p/dZMbgg  

Page 27: Intro to Using MCollective - PuppetConf 2014
Page 28: Intro to Using MCollective - PuppetConf 2014
Page 29: Intro to Using MCollective - PuppetConf 2014

Filters  ==  Find  a  Sec4on  

Page 30: Intro to Using MCollective - PuppetConf 2014

Pu^ng  it  into  ac,on  

Page 31: Intro to Using MCollective - PuppetConf 2014
Page 32: Intro to Using MCollective - PuppetConf 2014

S,ll  not  quite  the  Orchestra  

Page 33: Intro to Using MCollective - PuppetConf 2014

A  way  to  achieve  that…  

Page 34: Intro to Using MCollective - PuppetConf 2014

#!/bin/bash -e for node in $(mco find --np -C roles::node)

do

echo "restarting ssh on $node"

mco service --np sshd restart -I $node >/dev/null

sleep 2

mco rpc service status service=sshd -I $node -j | \

grep "status.*running" >/dev/null 2>&1

echo "ssh is up on $node" done

Page 35: Intro to Using MCollective - PuppetConf 2014

#!/usr/bin/ruby

require 'mcollective' include MCollective::RPC

util = rpcclient("rpcutil")

util.progress = false util.class_filter /roles::node/ nodes = []

util.ping.each do |resp| nodes << resp[:sender]

end util.disconnect

status = "" nodes.each do |node| srv = rpcclient("service")

srv.progress = false srv.identity_filter node

puts "restarting sshd on #{node}" srv.restart(:service => "sshd") srv.reset

i = 0

while i < 3 do srv.status(:service => "sshd").each do |resp| status = resp[:data][:status]

end if status == "running"

break end srv.reset

sleep 1 i += 1

end if status != "running"

puts "failed to restart sshd" exit 1

end

puts "ssh is up #{node}" end

Page 36: Intro to Using MCollective - PuppetConf 2014

Just some info…

NO DEMO

Page 37: Intro to Using MCollective - PuppetConf 2014

Ques,ons?  

BTW  -­‐  Demo  brought  to  you  by  h3ps://github.com/ripienaar/mcollec,ve-­‐vagrant,  check  it  out.    

Also,  thank  you  R.I.  Pienaar.  


Recommended