Permalink
Browse files

Issue 141 - Release 0.4.9

Merge branch 'development'
  • Loading branch information...
2 parents 5408434 + f916f5d commit 204869300f058ce03ef18d7d55ff3095d41c72fd The Marionette Collective committed Sep 21, 2010
Showing with 1,740 additions and 546 deletions.
  1. +16 −21 Rakefile
  2. +1 −1 ext/activemq/examples/single-broker/README
  3. +22 −32 ext/activemq/examples/single-broker/activemq.xml
  4. +158 −0 ext/mc-irb
  5. +1 −1 ext/mc-rpc-restserver.rb
  6. +5 −2 ext/openbsd/port-files/mcollective/Makefile
  7. +5 −5 ext/openbsd/port-files/mcollective/distinfo
  8. +2 −2 ext/openbsd/port-files/mcollective/patches/{patch-Makefile → patch-ext_Makefile}
  9. +0 −1 ext/openbsd/port-files/mcollective/pkg/PLIST
  10. +7 −0 lib/mcollective.rb
  11. +1 −1 lib/mcollective/client.rb
  12. +8 −1 lib/mcollective/config.rb
  13. +2 −190 lib/mcollective/rpc.rb
  14. +22 −14 lib/mcollective/rpc/agent.rb
  15. +2 −2 lib/mcollective/rpc/client.rb
  16. +10 −5 lib/mcollective/rpc/ddl.rb
  17. +187 −0 lib/mcollective/rpc/helpers.rb
  18. +145 −145 lib/mcollective/rpc/stats.rb
  19. +6 −38 lib/mcollective/runner.rb
  20. +84 −0 lib/mcollective/runnerstats.rb
  21. +5 −6 lib/mcollective/security/base.rb
  22. +45 −24 mc-inventory
  23. +24 −1 mc-rpc
  24. +2 −2 mcollective.spec
  25. +111 −0 plugins/mcollective/agent/rpcutil.ddl
  26. +64 −0 plugins/mcollective/agent/rpcutil.rb
  27. +2 −2 plugins/mcollective/security/psk.rb
  28. +2 −2 plugins/mcollective/security/ssl.rb
  29. +1 −1 website/_includes/consultation.html
  30. +10 −7 website/_includes/main_menu.html
  31. +2 −2 website/_includes/news.html
  32. +1 −0 website/_includes/overview_sidebar.html
  33. +10 −0 website/_includes/roadmap_sidebar.html
  34. +10 −0 website/_includes/search.html
  35. +37 −13 website/_layouts/mcollective.html
  36. +17 −0 website/changelog.textile
  37. +23 −13 website/css/mcollective.css
  38. BIN website/images/mcollective-aaa.png
  39. +3 −3 website/introduction/index.md
  40. +11 −2 website/introduction/screencasts.md
  41. +151 −0 website/introduction/security.md
  42. +3 −2 website/reference/basic/configuration.md
  43. +2 −1 website/reference/development/releasetasks.md
  44. +3 −1 website/reference/index.md
  45. +4 −1 website/reference/integration/activemq_security.md
  46. +71 −0 website/reference/integration/activemq_ssl.md
  47. +79 −0 website/reference/plugins/rpcutil.md
  48. +1 −1 website/reference/plugins/security_ssl.md
  49. +12 −0 website/reference/ui/nodereports.md
  50. +45 −0 website/releasenotes.textile
  51. +39 −0 website/roadmap/actions_in_other_languages.md
  52. +50 −0 website/roadmap/cucumber.md
  53. +79 −0 website/roadmap/queueing_and_scheduling.md
  54. +40 −0 website/roadmap/simplerpc_agents.md
  55. +35 −0 website/roadmap/single_execute.md
  56. +28 −0 website/roadmap/thread_management.md
  57. +16 −0 website/searchresults.md
  58. +3 −0 website/simplerpc/agents.md
  59. +4 −0 website/simplerpc/clients.md
  60. +8 −1 website/simplerpc/ddl.md
  61. +3 −0 website/simplerpc/index.md
View
@@ -6,7 +6,7 @@ require 'rake/clean'
require 'find'
PROJ_DOC_TITLE = "The Marionette Collective"
-PROJ_VERSION = "0.4.8"
+PROJ_VERSION = "0.4.9"
PROJ_RELEASE = "1"
PROJ_NAME = "mcollective"
PROJ_RPM_NAMES = [PROJ_NAME]
@@ -16,7 +16,7 @@ PROJ_FILES.concat(Dir.glob("mc-*"))
ENV["RPM_VERSION"] ? CURRENT_VERSION = ENV["RPM_VERSION"] : CURRENT_VERSION = PROJ_VERSION
ENV["BUILD_NUMBER"] ? CURRENT_RELEASE = ENV["BUILD_NUMBER"] : CURRENT_RELEASE = PROJ_RELEASE
-CLEAN.include("build")
+CLEAN.include(["build", "doc"])
def announce(msg='')
STDERR.puts "================"
@@ -47,17 +47,11 @@ task :package => [:clean, :doc] do
FileUtils.mkdir_p("build/#{PROJ_NAME}-#{CURRENT_VERSION}")
system("cp -R #{PROJ_FILES.join(' ')} build/#{PROJ_NAME}-#{CURRENT_VERSION}")
- system("cd build && tar --exclude .svn -cvzf #{PROJ_NAME}-#{CURRENT_VERSION}.tgz #{PROJ_NAME}-#{CURRENT_VERSION}")
-end
-desc "Tag the release in SVN"
-task :tag => [:rpm] do
- ENV["TAGS_URL"] ? TAGS_URL = ENV["TAGS_URL"] : TAGS_URL = `/usr/bin/svn info|/bin/awk '/Repository Root/ {print $3}'`.chomp + "/tags"
+ announce "Setting MCollective.version to #{CURRENT_VERSION}"
+ system("cd build/#{PROJ_NAME}-#{CURRENT_VERSION}/lib && sed --in-place -e s/@DEVELOPMENT_VERSION@/#{CURRENT_VERSION}/ mcollective.rb")
- raise("Need to specify a SVN url for tags using the TAGS_URL environment variable") unless TAGS_URL
-
- announce "Tagging the release for version #{CURRENT_VERSION}-#{CURRENT_RELEASE}"
- system %{svn copy -m 'Hudson adding release tag #{CURRENT_VERSION}-#{CURRENT_RELEASE}' ../#{PROJ_NAME}/ #{TAGS_URL}/#{PROJ_NAME}-#{CURRENT_VERSION}-#{CURRENT_RELEASE}}
+ system("cd build && tar --exclude .svn -cvzf #{PROJ_NAME}-#{CURRENT_VERSION}.tgz #{PROJ_NAME}-#{CURRENT_VERSION}")
end
desc "Creates the website as a tarball"
@@ -108,16 +102,6 @@ desc "Create the .debs"
task :deb => [:clean, :doc, :package] do
announce("Building debian packages")
- File.open("ext/debian/changelog", "w") do |f|
- f.puts("mcollective (#{CURRENT_VERSION}-#{CURRENT_RELEASE}) unstable; urgency=low")
- f.puts
- f.puts(" * Automated release for #{CURRENT_VERSION}-#{CURRENT_RELEASE} by rake deb")
- f.puts
- f.puts(" See http://marionette-collective.org/releasenotes.html for full details")
- f.puts
- f.puts(" -- The Marionette Collective <mcollective-dev@googlegroups.com> #{Time.new.strftime('%a, %d %b %Y %H:%M:%S %z')}")
- end
-
FileUtils.mkdir_p("build/deb")
Dir.chdir("build/deb") do
system %{tar -xzf ../#{PROJ_NAME}-#{CURRENT_VERSION}.tgz}
@@ -126,6 +110,17 @@ task :deb => [:clean, :doc, :package] do
Dir.chdir("#{PROJ_NAME}-#{CURRENT_VERSION}") do
system %{cp -R ext/debian .}
system %{cp -R ext/Makefile .}
+
+ File.open("debian/changelog", "w") do |f|
+ f.puts("mcollective (#{CURRENT_VERSION}-#{CURRENT_RELEASE}) unstable; urgency=low")
+ f.puts
+ f.puts(" * Automated release for #{CURRENT_VERSION}-#{CURRENT_RELEASE} by rake deb")
+ f.puts
+ f.puts(" See http://marionette-collective.org/releasenotes.html for full details")
+ f.puts
+ f.puts(" -- The Marionette Collective <mcollective-dev@googlegroups.com> #{Time.new.strftime('%a, %d %b %Y %H:%M:%S %z')}")
+ end
+
system %{debuild -i -us -uc -b}
end
@@ -1,4 +1,4 @@
-Simple single broker setup for ActiveMQ 5.3.0.
+Simple single broker setup for ActiveMQ 5.4.0.
Provides 2 users, one admin and one for mcollective.
Admin user can create all sorts of queues and topics,
@@ -3,33 +3,14 @@
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
- http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
+ http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd
http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
- <broker xmlns="http://activemq.apache.org/schema/core" brokerName="stomp1" useJmx="true">
+ <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" useJmx="true">
<managementContext>
- <managementContext connectorPort="1099" jmxDomainName="org.apache.activemq"/>
+ <managementContext createConnector="false"/>
</managementContext>
- <systemUsage>
- <systemUsage>
- <memoryUsage>
- <memoryUsage limit="20 mb" />
- </memoryUsage>
- <storeUsage>
- <storeUsage limit="1 gb" />
- </storeUsage>
- <tempUsage>
- <tempUsage limit="100 mb" />
- </tempUsage>
- </systemUsage>
- </systemUsage>
-
- <transportConnectors>
- <transportConnector name="openwire" uri="tcp://0.0.0.0:6166"/>
- <transportConnector name="stomp" uri="stomp://0.0.0.0:6163"/>
- </transportConnectors>
-
<plugins>
<statisticsBrokerPlugin/>
<simpleAuthenticationPlugin>
@@ -52,15 +33,24 @@
</map>
</authorizationPlugin>
</plugins>
- </broker>
- <jetty xmlns="http://mortbay.com/schemas/jetty/1.0">
- <connectors>
- <nioConnector port="8160"/>
- </connectors>
-
- <handlers>
- <webAppContext contextPath="/admin" resourceBase="/var/lib/activemq/webapps/admin" logUrlOnStart="true"/>
- </handlers>
- </jetty>
+ <systemUsage>
+ <systemUsage>
+ <memoryUsage>
+ <memoryUsage limit="20 mb"/>
+ </memoryUsage>
+ <storeUsage>
+ <storeUsage limit="1 gb" name="foo"/>
+ </storeUsage>
+ <tempUsage>
+ <tempUsage limit="100 mb"/>
+ </tempUsage>
+ </systemUsage>
+ </systemUsage>
+
+ <transportConnectors>
+ <transportConnector name="openwire" uri="tcp://0.0.0.0:6166"/>
+ <transportConnector name="stomp" uri="stomp://0.0.0.0:6163"/>
+ </transportConnectors>
+ </broker>
</beans>
View
@@ -0,0 +1,158 @@
+#!/usr/bin/env ruby
+
+# Simple IRB shell for mcollective
+#
+# mc-irb nrpe
+# Determining the amount of hosts matching filter for 2 seconds .... 47
+# >> rpc :runcommand, :command => "check_disks"
+#
+# * [ ============================================================> ] 47 / 47
+#
+#
+# dev1.your.net Request Aborted
+# CRITICAL
+# Output: DISK CRITICAL - free space: / 176 MB (4% inode=86%);
+# Exit Code: 2
+# Performance Data: /=3959MB;3706;3924;0;4361 /boot=26MB;83;88;0;98 /dev/shm=0MB;217;230;0;256
+#
+# => true
+# >> mchelp
+# <shows the DDL based help for the chosen agent>
+# => true
+# >> rpc(:runcommand, :command => "check_disks") do |resp|
+# ?> puts resp[:sender] + ": " + resp[:data][:output]
+# >> end
+#
+# * [ ============================================================> ] 47 / 47
+#
+# dev1.your.net: DISK OK
+# <snip>
+# => true
+# >>
+#
+# You can access the agent variable via @agent from where you can do the usual manipulation of filters etc,
+# if you wish to switch to a different agent mid run just do newagent("some_other_agent")
+#
+# If you install the Bond gem you'll get some DDL assisted completion in the rpc method
+require 'rubygems'
+require 'irb'
+
+def consolize &block
+ yield
+
+ IRB.setup(nil)
+ irb = IRB::Irb.new
+ IRB.conf[:MAIN_CONTEXT] = irb.context
+ irb.context.evaluate("require 'irb/completion'", 0)
+
+ begin
+ require 'bond'
+ Bond.start
+
+ Bond.complete(:method => "rpc") do |e|
+ begin
+ if e.argument == 1
+ if e.arguments.last == "?"
+ puts "\n\nActions for #{@agent_name}:\n"
+
+ @agent.ddl.actions.each do |action|
+ puts "%20s - %s" % [ ":#{action}", @agent.ddl.action_interface(action)[:description] ]
+ end
+
+ print "\n" + e.line
+ end
+
+ @agent.ddl.actions
+
+ elsif e.argument > 1
+ action = eval(e.arguments[0]).to_s
+ ddl = @agent.ddl.action_interface(action)
+
+ if e.arguments.last == "?"
+ puts "\n\nArguments for #{action}:\n"
+ ddl[:input].keys.each do |input|
+ puts "%20s - %s" % [ ":#{input}", ddl[:input][input][:description] ]
+ end
+
+ print "\n" + e.line
+ end
+
+ ddl[:input].keys
+ end
+ rescue Exception
+ []
+ end
+ end
+ rescue Exception
+ end
+
+ trap("SIGINT") do
+ irb.signal_handle
+ end
+ catch(:IRB_EXIT) do
+ irb.eval_input
+ end
+end
+
+def mchelp
+ system("mc-rpc --agent-help #{@agent_name}|less")
+ true
+end
+
+def rpc(method_name, *args, &block)
+ unless block_given?
+ if args.size > 0
+ args = args.first
+ else
+ args = {}
+ end
+
+ if args[:verbose]
+ args.delete(:verbose)
+
+ printrpc(@agent.send(method_name, args), :verbose => true)
+ printrpcstats
+ else
+ printrpc @agent.send(method_name, args)
+ printrpcstats
+ end
+
+ else
+ @agent.send(method_name, args.first).each do |resp|
+ yield resp
+ end
+
+ printrpcstats
+ end
+
+ true
+rescue MCollective::DDLValidationError => e
+ puts "Request did not pass DDL validation: #{e}"
+end
+
+def newagent(agent)
+ @agent_name = agent
+
+ @options[:filter]["agent"] = []
+ @agent = rpcclient(@agent_name, :options => @options)
+ @agent.discover(:verbose => true)
+ @agent.progress = true
+
+ true
+end
+
+consolize do
+ require 'mcollective'
+
+
+ include MCollective::RPC
+
+ @options = rpcoptions{|p,o| }
+
+ unless ARGV.size == 1
+ puts "Please specify an agent name on the command line"
+ exit 1
+ end
+
+ newagent(ARGV[0])
+end
View
@@ -29,6 +29,6 @@
arguments[$1.to_sym] = $2 if arg =~ /^(.+?)=(.+)$/
end
- JSON.dump(mc.send(params[:action], arguments))
+ JSON.dump(mc.send(params[:action], arguments).map{|r| r.results})
end
@@ -1,11 +1,11 @@
PKG_ARCH= *
COMMENT= The Marionette Collective
-DISTNAME= mcollective-0.4.7
+DISTNAME= mcollective-0.4.8
CATEGORIES= sysutils
-HOMEPAGE= http://marionette-collective.org/
+HOMEPAGE= http://marionette-collective.org
MASTER_SITES= http://mcollective.googlecode.com/files/
EXTRACT_SUFX= .tgz
@@ -18,4 +18,7 @@ PERMIT_DISTFILES_FTP= Yes
NO_BUILD= Yes
NO_REGRESS= Yes
+# makefile is in ext/
+MAKE_FILE=ext/Makefile
+
.include <bsd.port.mk>
@@ -1,5 +1,5 @@
-MD5 (mcollective-0.4.7.tgz) = 78Ho11bER8X2+Fe5AqhyyQ==
-RMD160 (mcollective-0.4.7.tgz) = Uj5pO+svNSIvf4k5RibNeLsFcng=
-SHA1 (mcollective-0.4.7.tgz) = sJzLW9OQ8owZ/mIzHgYj9z4fDd0=
-SHA256 (mcollective-0.4.7.tgz) = aJLAv3uLQtkBCMefW5o5urqh9h37e67eRi87jn4t2cU=
-SIZE (mcollective-0.4.7.tgz) = 194715
+MD5 (mcollective-0.4.8.tgz) = iX1UOwoe9jTfhS1VcYuFsA==
+RMD160 (mcollective-0.4.8.tgz) = L/qo347vdEpnQ62pij0EHJzr618=
+SHA1 (mcollective-0.4.8.tgz) = fT3oBwOEUS+MrRs8NnxCQ3d4SRY=
+SHA256 (mcollective-0.4.8.tgz) = AZpJydajlM+XPpcQ9VSnz4TME/xrp9F3v4/wBTs7ylU=
+SIZE (mcollective-0.4.8.tgz) = 147561
@@ -1,6 +1,6 @@
$OpenBSD$
---- Makefile.orig Mon Jun 14 09:21:38 2010
-+++ Makefile Thu Jun 24 13:43:33 2010
+--- ext/Makefile.orig Tue Aug 24 16:26:59 2010
++++ ext/Makefile Tue Aug 24 16:27:08 2010
@@ -1,6 +1,5 @@
#!/usr/bin/make -f
@@ -44,7 +44,6 @@ sbin/mc-find-hosts
sbin/mc-inventory
sbin/mc-ping
sbin/mc-rpc
-sbin/mc-rpc-restserver.rb
sbin/mcollectived
share/doc/mcollective/
share/doc/mcollective/classes/
View
@@ -32,6 +32,7 @@ class DDLValidationError<RuntimeError;end
autoload :Config, "mcollective/config"
autoload :Log, "mcollective/log"
autoload :Runner, "mcollective/runner"
+ autoload :RunnerStats, "mcollective/runnerstats"
autoload :Agents, "mcollective/agents"
autoload :Client, "mcollective/client"
autoload :Util, "mcollective/util"
@@ -43,6 +44,12 @@ class DDLValidationError<RuntimeError;end
autoload :PluginManager, "mcollective/pluginmanager"
autoload :RPC, "mcollective/rpc"
autoload :Request, "mcollective/request"
+
+ VERSION="@DEVELOPMENT_VERSION@"
+
+ def self.version
+ VERSION
+ end
end
# vi:tabstop=4:expandtab:ai
@@ -7,7 +7,7 @@ class Client
def initialize(configfile)
@config = Config.instance
- @config.loadconfig(configfile)
+ @config.loadconfig(configfile) unless @config.configured
@log = Log.instance
@connection = PluginManager["connector_plugin"]
Oops, something went wrong.

0 comments on commit 2048693

Please sign in to comment.