Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Commit

Permalink
Add a -f option that will bypass splying for runonce
Browse files Browse the repository at this point in the history
  • Loading branch information
ripienaar committed Aug 18, 2010
1 parent bf9eb22 commit f34a2e9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions agent/puppetd/mc-puppetd
Expand Up @@ -8,9 +8,18 @@ require 'mcollective'

include MCollective::RPC

@force = false

options = rpcoptions do |parser, options|
parser.define_head "Manage remote puppet daemons"
parser.banner = "Usage: mc-puppetd [enable|disable|runonce|status|count|runall] [concurrency]"

parser.separator ""
parser.separator "Run Options"

parser.on("--force", "-f", "Force the puppet run to happen immediately without splay") do
@force = true
end
end

puppetd = rpcclient("puppetd", :options => options)
Expand Down Expand Up @@ -108,6 +117,11 @@ elsif command == "runall"
puts("Please specify a maximum concurrency")
exit 1
end
elsif command == "runonce"
printrpc puppetd.runonce(:forcerun => @force)

printrpcstats

else
printrpc puppetd.send(command)

Expand Down

0 comments on commit f34a2e9

Please sign in to comment.