kitchen_hooks 1.7.0 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Readme.md +4 -0
- data/VERSION +1 -1
- data/kitchen_hooks.gemspec +1 -1
- data/lib/kitchen_hooks/helpers/sync_servers.rb +23 -7
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c55fcb4b71fbb2010f6d46b256f2d84b4953dd9c
|
4
|
+
data.tar.gz: 3efdac0901f9b235e3c237dff23e52e99fae879f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6648b4f9e50981912b9d0199bf09d45ec9d970b125131832a0534dda5c70c8e5e5d002f13c5459adf4d0f3e966e6a933641f8d7f8b73018419fcf142217fc7fe
|
7
|
+
data.tar.gz: 9186ae05a8d2d515b3a6ba1a1e89268bbdd3650507fa736ef0b6968c5aab3c00f3a75529974cefd2adfe95c6c351fdf501ff5ba40605d9bb777ec826bdd46235
|
data/Readme.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.7.
|
1
|
+
1.7.1
|
data/kitchen_hooks.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.add_runtime_dependency 'daybreak', '~> 0.3'
|
18
18
|
s.add_runtime_dependency 'retryable', '~> 2'
|
19
19
|
s.add_runtime_dependency 'berkshelf', '~> 3'
|
20
|
-
s.add_runtime_dependency 'chef', '
|
20
|
+
s.add_runtime_dependency 'chef', '< 12'
|
21
21
|
s.add_runtime_dependency 'thor', '~> 0'
|
22
22
|
s.add_runtime_dependency 'git', '~> 1.2'
|
23
23
|
s.add_runtime_dependency 'sinatra', '~> 1.4'
|
@@ -8,10 +8,10 @@ class SyncServers
|
|
8
8
|
|
9
9
|
|
10
10
|
def initialize knives
|
11
|
-
@knives
|
11
|
+
@knives = knives
|
12
12
|
@started = Time.now
|
13
|
-
@status
|
14
|
-
elapsed: Time.now - @started
|
13
|
+
@status = sync_servers.merge \
|
14
|
+
elapsed: Time.now - @started rescue nil
|
15
15
|
end
|
16
16
|
|
17
17
|
|
@@ -24,14 +24,22 @@ private
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def all_nodes
|
27
|
+
@clients ||= {}
|
27
28
|
@all_nodes ||= ridleys.flat_map do |ridley|
|
28
|
-
ridley.
|
29
|
+
clients = ridley.client.all
|
30
|
+
nodes = ridley.partial_search(:node, '*:*', %w[ ohai_time ])
|
31
|
+
|
32
|
+
nodes.each do |n|
|
33
|
+
c = clients.select { |c| c.name == n.name }.shift
|
34
|
+
@clients[n.name] = c unless c.nil?
|
35
|
+
end
|
36
|
+
|
37
|
+
nodes
|
29
38
|
end
|
30
39
|
end
|
31
40
|
|
32
|
-
|
33
41
|
def merged_nodes
|
34
|
-
@merged_nodes ||= all_nodes.group_by(&:name).pmap do |
|
42
|
+
@merged_nodes ||= all_nodes.group_by(&:name).pmap do |_, copies|
|
35
43
|
copies.sort_by { |c| c.automatic.ohai_time }.last
|
36
44
|
end
|
37
45
|
end
|
@@ -41,13 +49,21 @@ private
|
|
41
49
|
nodes = merged_nodes
|
42
50
|
failures = Set.new
|
43
51
|
|
44
|
-
nodes.peach(
|
52
|
+
nodes.peach(16) do |n|
|
45
53
|
n.reload
|
54
|
+
|
46
55
|
ridleys.peach(4) do |ridley|
|
47
56
|
ridley.node.create(n) \
|
48
57
|
rescue ridley.node.update(n) \
|
49
58
|
rescue failures << n.name
|
59
|
+
|
60
|
+
c = @clients[n.name]
|
61
|
+
next if c.nil?
|
62
|
+
ridley.client.create(c) \
|
63
|
+
rescue ridley.client.update(c) \
|
64
|
+
rescue puts('WARNING: Client sync failed for node "%s"' % n.name)
|
50
65
|
end
|
66
|
+
|
51
67
|
puts 'Synced node "%s"' % n.name
|
52
68
|
end
|
53
69
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen_hooks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Clemmer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hipchat
|
@@ -70,16 +70,16 @@ dependencies:
|
|
70
70
|
name: chef
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - "<"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 12
|
75
|
+
version: '12'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - "<"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 12
|
82
|
+
version: '12'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: thor
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|