rundock 0.4.8 → 0.4.10
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/rundock/hook/base.rb +1 -1
- data/lib/rundock/node.rb +3 -3
- data/lib/rundock/plugin/hook/file.rb +2 -2
- data/lib/rundock/version.rb +1 -1
- data/spec/integration/recipes/file_hook_spec.rb +2 -0
- data/spec/integration/scenarios/simple_file_hooks_scenario.yml +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d57db6da4ef09d2b72d4100d7a0fefb1404bb06a
|
|
4
|
+
data.tar.gz: 0d778d72fffd50b046d32d86300d2847de359b3a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 09f7c9a551f014b35ed6ae5dc03279694805a2a4b9745f9db66560b362d7a4ede30aedd1c8bfb44b52c822c4a138fe719157fe7ec9171f2d0023b7e3e45f7772
|
|
7
|
+
data.tar.gz: 65a57189d24d4da66da1652d0ee2ccd3b26b85d0f52bd6c05379cb37abfbd3fcfa4f82a9b23453d04d1a218d2c0ee6ba9c32fe92192447e64087552921c649c1
|
data/CHANGELOG.md
CHANGED
data/lib/rundock/hook/base.rb
CHANGED
data/lib/rundock/node.rb
CHANGED
|
@@ -24,11 +24,11 @@ module Rundock
|
|
|
24
24
|
Logger.debug("run node: #{@name}")
|
|
25
25
|
Logger.warn("no operation running: #{@name}") if @operations.blank?
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
node_attributes = []
|
|
28
28
|
|
|
29
29
|
@operations.each do |ope|
|
|
30
30
|
Logger.debug("run operation: #{ope.class}")
|
|
31
|
-
|
|
31
|
+
node_attributes << ope.attributes
|
|
32
32
|
ope.run(@backend, ope.attributes)
|
|
33
33
|
end
|
|
34
34
|
|
|
@@ -36,7 +36,7 @@ module Rundock
|
|
|
36
36
|
|
|
37
37
|
@hooks.each do |h|
|
|
38
38
|
Logger.debug("run hook: #{h.name}")
|
|
39
|
-
h.hook(
|
|
39
|
+
h.hook(node_attributes, log_buffer)
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
Logger.formatter.onrec = false
|
|
@@ -32,9 +32,9 @@ module Rundock
|
|
|
32
32
|
# key: ~/.ssh/id_rsa
|
|
33
33
|
# ---
|
|
34
34
|
class File < Base
|
|
35
|
-
def hook(
|
|
35
|
+
def hook(node_attributes, log_buffer)
|
|
36
36
|
file = ::File.open(@contents[:filepath], 'w')
|
|
37
|
-
file.puts("[hookname:#{@name} node:#{
|
|
37
|
+
file.puts("[hookname:#{@name} node:#{node_attributes[0][:nodename]}]")
|
|
38
38
|
log_buffer.each do |log|
|
|
39
39
|
file.puts("[\%5s:] %s%s\n" % [log.severity, ' ' * 2 * log.indent_depth, log.msg])
|
|
40
40
|
end
|
data/lib/rundock/version.rb
CHANGED
|
@@ -7,11 +7,13 @@ end
|
|
|
7
7
|
|
|
8
8
|
describe file('/var/tmp/hello_rundock_from_file_hook_array_1_scenario') do
|
|
9
9
|
it { should be_file }
|
|
10
|
+
its(:content) { should match(/anyhost-01/) }
|
|
10
11
|
its(:content) { should match(/hookname:file_array_1 /) }
|
|
11
12
|
end
|
|
12
13
|
|
|
13
14
|
describe file('/var/tmp/hello_rundock_from_file_hook_array_2_scenario') do
|
|
14
15
|
it { should be_file }
|
|
16
|
+
its(:content) { should match(/anyhost-01/) }
|
|
15
17
|
its(:content) { should match(/hookname:file_array_2 /) }
|
|
16
18
|
end
|
|
17
19
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
- node: anyhost-01
|
|
2
2
|
command:
|
|
3
3
|
- "echo 'hookname:file_one ' > /var/tmp/hello_rundock_from_file_hook_one_scenario"
|
|
4
|
-
- "echo '
|
|
5
|
-
- "echo '
|
|
4
|
+
- "echo 'anyhost-01' > /var/tmp/hello_rundock_from_file_hook_array_1_scenario"
|
|
5
|
+
- "echo 'anyhost-01' > /var/tmp/hello_rundock_from_file_hook_array_2_scenario"
|
|
6
|
+
- "echo 'hookname:file_array_1 ' >> /var/tmp/hello_rundock_from_file_hook_array_1_scenario"
|
|
7
|
+
- "echo 'hookname:file_array_2 ' >> /var/tmp/hello_rundock_from_file_hook_array_2_scenario"
|
|
6
8
|
hook:
|
|
7
9
|
- file_one
|
|
8
10
|
- file_array_1
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rundock
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- hiracy
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-08-
|
|
11
|
+
date: 2015-08-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|