rundock 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 302b39673ea10b293acef36a5a5d4721304da44c
4
- data.tar.gz: fa368f83106cb9ae59157245dd40c73a51263aa4
3
+ metadata.gz: cd86e3bf60eb07acbfe869221b28cc445251e41f
4
+ data.tar.gz: cd4808f922cc35762acef22b55656619619e087e
5
5
  SHA512:
6
- metadata.gz: 31d69551871844f1f19bc18513705520c5b573c33e28c69bef954ff84d457b33dc23276c6a416f0194ca7626e2f3c409854f8956b30331692ad5626e84671fa0
7
- data.tar.gz: 88d4befec80c3830407d4f147d6ce0db43e7c6f32a613a23994cda3f3b5b7277998fecb867f81de9904eac9082ad47ab8b619a6d4fd793b72e66aef6ec62f5f1
6
+ metadata.gz: fd6d605d18caf3433f50ee4cfc21a98ea65cd0e1193f2761fd880e4afcd7da88b73e3f8f0aa250a4a1d052594ca78c089d6cefcf694854bdfb2aa42c62d6ec84
7
+ data.tar.gz: 12d0a947c4516e2585e015619aca7d892db8f34727a4e8f1ccf27bea45f6fa7d4eaebcb9e7836cee25fbbb7b49fb0b38eb13939754da0b76c32a9d40233d0cab
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## v0.2.5
2
+
3
+ Improvements
4
+
5
+ - Support host inventory
6
+
1
7
  ## v0.2.4
2
8
 
3
9
  Fix
@@ -66,6 +66,10 @@ module Rundock
66
66
  raise NotImplementedError
67
67
  end
68
68
 
69
+ def host_inventory
70
+ @backend.host_inventory
71
+ end
72
+
69
73
  def method_missing(method, *args)
70
74
  @backend.send(method, *args)
71
75
  end
@@ -0,0 +1,43 @@
1
+ require 'rundock/operation/base'
2
+
3
+ module Rundock
4
+ module Operation
5
+ # You can use this sample as following scenario.yml for example.
6
+ #
7
+ # - node: anyhost-01
8
+ # host_inventory:
9
+ # memory:
10
+ # total:
11
+ # ---
12
+ # anyhost-01:
13
+ # host: 192.168.1.11
14
+ # ssh_opts:
15
+ # port: 22
16
+ # user: anyuser
17
+ # key: ~/.ssh/id_rsa
18
+ # ---
19
+ class HostInventory < Base
20
+ def run(backend, attributes)
21
+ attributes[:host_inventory].each do |hi|
22
+ Logger.info(to_inventory(backend, hi))
23
+ end
24
+ end
25
+
26
+ private
27
+
28
+ def to_inventory(backend, inventory)
29
+ ret = nil
30
+ inventory.split('/').each do |s|
31
+ if ret.nil?
32
+ ret = backend.host_inventory[s.to_s]
33
+ next
34
+ end
35
+
36
+ ret = ret[s.to_s]
37
+ end
38
+
39
+ ret
40
+ end
41
+ end
42
+ end
43
+ end
@@ -1,3 +1,3 @@
1
1
  module Rundock
2
- VERSION = '0.2.4'
2
+ VERSION = '0.2.5'
3
3
  end
@@ -1,4 +1,6 @@
1
1
  - node: anyhost-01
2
+ host_inventory:
3
+ - memory/total
2
4
  task:
3
5
  - write_echo
4
6
  ---
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rundock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - hiracy
@@ -168,6 +168,7 @@ files:
168
168
  - lib/rundock/operation/command.rb
169
169
  - lib/rundock/operation/task.rb
170
170
  - lib/rundock/operation_factory.rb
171
+ - lib/rundock/plugin/operation/host_inventory.rb
171
172
  - lib/rundock/plugin/operation/sample_operation.rb
172
173
  - lib/rundock/runner.rb
173
174
  - lib/rundock/scenario.rb