Created
May 27, 2011 20:33
-
-
Save proffalken/996111 to your computer and use it in GitHub Desktop.
deploy.rb with MCollective and Puppet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set :stages, %w[staging production] | |
set :application, "Puppet Manifests" | |
set :repository, "git://localhost/puppet.git" | |
set :scm, :git | |
role :web, "puppetmaster" # set this to the fully qualified domain name of your puppetmaster | |
require 'capistrano/ext/multistage' | |
require 'mcollective' | |
#### MCOLLECTIVE STUFF #### | |
class MCProxy | |
include MCollective::RPC | |
def initialize(agent) | |
@agent = rpcclient(agent) | |
end | |
def runaction(action, args) | |
printrpc @agent.send(action, args) | |
end | |
end | |
namespace :puppet do | |
desc <<-DESC | |
Run Puppet to pull the latest versions | |
DESC | |
task :run do | |
puppet = MCProxy.new("puppetd") | |
puppet.runaction("runonce",:concurrency => '2') | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment