Skip to content
Browse files

Add a -f option that will bypass splying for runonce

  • Loading branch information...
1 parent bf9eb22 commit f34a2e969a63ecb23c9c129a1dadc0dca73a9b9c @ripienaar ripienaar committed
Showing with 14 additions and 0 deletions.
  1. +14 −0 agent/puppetd/mc-puppetd
View
14 agent/puppetd/mc-puppetd
@@ -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)
@@ -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)

0 comments on commit f34a2e9

Please sign in to comment.
Something went wrong with that request. Please try again.