marionette 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/README.md +21 -13
  2. data/bin/marionette +2 -0
  3. metadata +4 -4
data/README.md CHANGED
@@ -1,15 +1,14 @@
1
1
  Headstartapp::Marionette - ZMQ connection to puppet master
2
2
  ============================================================
3
3
 
4
- Marionette connects a headstartapp server instance (puppet node) to its
5
- master and executes puppet runs on demand. Marionette uses fast and lightweight
6
- 0MQ <http://zeromq.org> messaging system.
4
+ Marionette connects a puppet node to its master and executes puppet runs on demand.
5
+ Marionette uses fast and lightweight 0MQ <http://zeromq.org> messaging system.
7
6
 
8
- * From version 0.0.12 onward, Puppet.message returns an array and includes system command results.
7
+ * From version 0.0.14 onward, added methods: puppet!, facter! and run!
9
8
  * From version 0.0.9 onward, Marionette.setup automatically ran at connect.
10
9
  * From version 0.0.8 onward, use puppet agent for puppet runs
11
10
  * From version 0.0.7 onward, talk replaces send and receive.
12
- * From version 0.0.7 onward, marionette reconnects after n-poll attempts (10 by default).
11
+ * From version 0.0.7 onward, marionette reconnects after n-poll attempts (10 by default @ 100 millisecond interval).
13
12
  * From version 0.0.6 onward, marionette polls before receives.
14
13
 
15
14
 
@@ -47,18 +46,27 @@ Ruby:
47
46
 
48
47
  require 'rubygems'
49
48
  require 'marionette'
49
+
50
+ # With this option, ZMQ tries sending every 1 sec if recipient unavailable.
51
+ ZMQ::RECOVERY_IVL = 1
50
52
 
51
53
  puppet = HeadStartApp::Marionette::Connect.new(:uri=>"192.168.1.1:5555) puppet
52
54
  master = HeadStartApp::Marionette::Connect.new(:uri=>"192.168.1.1:5555").master
53
- message = {:run=>[:system,:facter,:puppet],:system=>{:command=>"echo 'test @ #{Time.now}' > /tmp/test.out"}}
54
- master.talk messagee
55
-
56
- # Results:
57
- #
58
- # 1) on the pupet, /tmp/test.out contains "test #{Time.now}"
59
- # 2) returns puppet's facts as a hash.
60
- # 3) completes a puppet run.
61
55
 
56
+ # Passing this argument polls node till reply is available (default = false).
57
+ # By default the master polls for 1 second.
58
+ poll_till_reply_available = true
59
+
60
+ # Executes a puppet run and returns output
61
+ puts master.puppet!(poll_till_reply_available)
62
+
63
+ # Executes facter and returns it as a hash
64
+ puts master.facter!(poll_till_reply_available)
65
+
66
+ # Executes an ad hoc system command
67
+ # Result on the node: /tmp/test.out contains "test #{Time.now}"
68
+ cmd = "echo 'test @ #{Time.now}' > /tmp/test.out && cat /tmp/test.out"
69
+ puts master.run!(cmd, poll_till_reply_available)
62
70
 
63
71
 
64
72
  CLI:
@@ -4,6 +4,8 @@ require 'rubygems'
4
4
  require 'daemons'
5
5
  require 'marionette'
6
6
 
7
+ ZMQ::RECOVERY_IVL = 1
8
+
7
9
  options = nil
8
10
 
9
11
  if ARGV.size > 1
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marionette
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 13
10
- version: 0.0.13
9
+ - 14
10
+ version: 0.0.14
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dan Lee
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-19 00:00:00 -08:00
18
+ date: 2011-01-22 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency