ironfan 4.11.0 → 4.11.1

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.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v4.11.1
2
+ * Added fall-back Chef::Client loading, if Solr index has fallen behind (thanks @brandonbell)
3
+ * Moved logging of resource loading into Resource.register, instead of individual resources
4
+
1
5
  # v4.11.0
2
6
  * Changed chef client semantics, to drop problematic deprecated "name" attribute
3
7
  * Adding `announcements` to RDS instances
data/Gemfile.lock CHANGED
@@ -2,7 +2,7 @@ GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
4
  archive-tar-minitar (0.5.2)
5
- builder (3.2.0)
5
+ builder (3.2.2)
6
6
  bunny (0.7.9)
7
7
  chef (10.26.0)
8
8
  bunny (>= 0.6.0, < 0.8.0)
@@ -22,11 +22,12 @@ GEM
22
22
  treetop (~> 1.4.9)
23
23
  uuidtools
24
24
  yajl-ruby (~> 1.1)
25
- chef-zero (1.1.3)
25
+ chef-zero (1.5.1)
26
26
  hashie (~> 2.0)
27
+ json
27
28
  mixlib-log (~> 1.3)
28
29
  moneta (< 0.7.0)
29
- puma (~> 2.0)
30
+ puma (~> 1.6)
30
31
  coderay (1.0.9)
31
32
  columnize (0.3.6)
32
33
  configliere (0.4.18)
@@ -35,7 +36,7 @@ GEM
35
36
  diff-lcs (1.2.4)
36
37
  erubis (2.7.0)
37
38
  excon (0.21.0)
38
- ffi (1.8.1)
39
+ ffi (1.9.0)
39
40
  fog (1.10.1)
40
41
  builder
41
42
  excon (~> 0.20)
@@ -52,13 +53,13 @@ GEM
52
53
  configliere (>= 0.4.13)
53
54
  json
54
55
  multi_json (>= 1.1)
55
- guard (1.8.0)
56
+ guard (1.8.1)
56
57
  formatador (>= 0.2.4)
57
58
  listen (>= 1.0.0)
58
59
  lumberjack (>= 1.0.2)
59
60
  pry (>= 0.9.10)
60
61
  thor (>= 0.14.6)
61
- guard-rspec (3.0.0)
62
+ guard-rspec (3.0.2)
62
63
  guard (>= 1.8)
63
64
  rspec (~> 2.13)
64
65
  guard-yard (2.1.0)
@@ -75,7 +76,7 @@ GEM
75
76
  json (1.5.4)
76
77
  linecache19 (0.5.12)
77
78
  ruby_core_source (>= 0.1.4)
78
- listen (1.1.2)
79
+ listen (1.2.2)
79
80
  rb-fsevent (>= 0.9.3)
80
81
  rb-inotify (>= 0.9)
81
82
  rb-kqueue (>= 0.2)
@@ -89,7 +90,7 @@ GEM
89
90
  mixlib-log (1.6.0)
90
91
  mixlib-shellout (1.1.0)
91
92
  moneta (0.6.0)
92
- multi_json (1.7.3)
93
+ multi_json (1.7.7)
93
94
  net-scp (1.1.1)
94
95
  net-ssh (>= 2.6.5)
95
96
  net-ssh (2.6.7)
@@ -98,7 +99,7 @@ GEM
98
99
  net-ssh-multi (1.1)
99
100
  net-ssh (>= 2.1.4)
100
101
  net-ssh-gateway (>= 0.99.0)
101
- nokogiri (1.5.9)
102
+ nokogiri (1.5.10)
102
103
  ohai (6.16.0)
103
104
  ipaddress
104
105
  mixlib-cli
@@ -107,16 +108,16 @@ GEM
107
108
  mixlib-shellout
108
109
  systemu
109
110
  yajl-ruby
110
- oj (2.0.12)
111
+ oj (2.1.2)
111
112
  polyglot (0.3.3)
112
113
  pry (0.9.12.2)
113
114
  coderay (~> 1.0.5)
114
115
  method_source (~> 0.8)
115
116
  slop (~> 3.4)
116
- puma (2.0.1)
117
- rack (>= 1.1, < 2.0)
117
+ puma (1.6.3)
118
+ rack (~> 1.2)
118
119
  rack (1.5.2)
119
- rake (10.0.4)
120
+ rake (10.1.0)
120
121
  rb-fsevent (0.9.3)
121
122
  rb-inotify (0.9.0)
122
123
  ffi (>= 0.5.0)
@@ -128,7 +129,7 @@ GEM
128
129
  trollop
129
130
  rdoc (4.0.1)
130
131
  json (~> 1.4)
131
- redcarpet (2.2.2)
132
+ redcarpet (2.3.0)
132
133
  rest-client (1.6.7)
133
134
  mime-types (>= 1.16)
134
135
  rspec (2.13.0)
@@ -158,7 +159,7 @@ GEM
158
159
  slop (3.4.5)
159
160
  systemu (2.5.2)
160
161
  thor (0.18.1)
161
- treetop (1.4.12)
162
+ treetop (1.4.14)
162
163
  polyglot
163
164
  polyglot (>= 0.3.1)
164
165
  trollop (2.0)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.11.0
1
+ 4.11.1
data/ironfan.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "ironfan"
8
- s.version = "4.11.0"
8
+ s.version = "4.11.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Infochimps"]
@@ -110,6 +110,7 @@ module Ironfan
110
110
  def self.remember(resource,options={})
111
111
  index = options[:id] || resource.name
112
112
  index += options[:append_id] if options[:append_id]
113
+ Chef::Log.debug("Loaded #{resource}")
113
114
  self.known[index] = resource
114
115
  end
115
116
 
@@ -117,7 +118,6 @@ module Ironfan
117
118
  def self.register(native)
118
119
  result = new(:adaptee => native) or return
119
120
  remember result
120
- result
121
121
  end
122
122
 
123
123
  def self.recall?(id)
@@ -45,11 +45,14 @@ module Ironfan
45
45
  # Discovery
46
46
  #
47
47
  def self.load!(cluster=nil)
48
- query = "clientname:#{cluster ? '*' : cluster.name}-*"
49
- ChefServer.search(:client, query) do |raw|
50
- next unless raw.present?
51
- client = register(raw)
52
- Chef::Log.debug("Loaded #{client}")
48
+ Chef::ApiClient.list(true).each { |name, raw| client = register(raw) }
49
+ return unless cluster
50
+
51
+ # Fallback, for when Solr isn't indexing clients fast enough
52
+ cluster.servers.each do |s|
53
+ next if recall? s.full_name # Already loaded
54
+ begin; register Chef::ApiClient.load(s.full_name)
55
+ rescue Net::HTTPServerException; end # Doesn't exist
53
56
  end
54
57
  end
55
58
 
@@ -58,16 +61,15 @@ module Ironfan
58
61
  #
59
62
  def self.create!(computer)
60
63
  return if computer.client?
61
- client = Client.new
62
- client.name computer.server.full_name
63
- client.admin false
64
+ client = Client.new
65
+ client.name computer.server.full_name
66
+ client.admin false
64
67
 
65
- params = {:name => client.name, :admin => client.admin, :private_key => true }
66
- result = ChefServer.post_rest("clients", params)
67
- client.private_key(result["private_key"])
68
+ result = client.save
69
+ client.private_key result["private_key"]
68
70
 
69
- computer[:client] = client
70
- remember client
71
+ computer[:client] = client
72
+ remember client
71
73
  end
72
74
 
73
75
  def self.destroy!(computer)
@@ -91,7 +91,6 @@ module Ironfan
91
91
  ChefServer.search(:node, query) do |raw|
92
92
  next unless raw.present?
93
93
  node = register(raw)
94
- Chef::Log.debug("Loaded #{node}")
95
94
  end
96
95
  end
97
96
 
@@ -49,9 +49,7 @@ module Ironfan
49
49
  def self.load!(cluster=nil)
50
50
  query = cluster && "name:#{cluster.name}-*"
51
51
  ChefServer.search(:role,query) do |raw|
52
- next unless raw.present?
53
- role = register(raw)
54
- Chef::Log.debug("Loaded #{role}")
52
+ register raw if raw.present?
55
53
  end
56
54
  end
57
55
 
@@ -61,7 +61,6 @@ module Ironfan
61
61
  else
62
62
  remember ebs
63
63
  end
64
- Chef::Log.debug("Loaded #{ebs}")
65
64
  end
66
65
  end
67
66
 
@@ -3,14 +3,14 @@ module Ironfan
3
3
  class Ec2
4
4
 
5
5
  class ElasticIp < Ironfan::Provider::Resource
6
- delegate :addresses, :associate_address, :allocation_id,
7
- :allocation_id=, :allocate_address, :auto_elastic_ip, :destroy,
8
- :domain, :domain=, :describe_addresses, :disassociate_address,
9
- :domain, :id, :network_interface_id, :network_interface_id=,
10
- :public_ip, :public_ip=, :public_ip_address, :save, :server=,
6
+ delegate :addresses, :associate_address, :allocation_id,
7
+ :allocation_id=, :allocate_address, :auto_elastic_ip, :destroy,
8
+ :domain, :domain=, :describe_addresses, :disassociate_address,
9
+ :domain, :id, :network_interface_id, :network_interface_id=,
10
+ :public_ip, :public_ip=, :public_ip_address, :save, :server=,
11
11
  :server, :server_id, :server_id=,
12
12
  :to => :adaptee
13
-
13
+
14
14
  def self.shared?() true; end
15
15
  def self.multiple?() false; end
16
16
  def self.resource_type() :elastic_ip; end
@@ -24,7 +24,6 @@ module Ironfan
24
24
  def self.load!(cluster=nil)
25
25
  Ec2.connection.addresses.each do |eip|
26
26
  register eip
27
- Chef::Log.debug("Loaded #{eip}")
28
27
 
29
28
  # The rest of this definition shows relevant information when -VV
30
29
  # is passed to knife and aids in troubleshooting any refusal to
@@ -33,10 +33,7 @@ module Ironfan
33
33
  #
34
34
  def self.load!(cluster=nil)
35
35
  Ec2.elb.load_balancers.each do |raw|
36
- next if raw.blank?
37
- elb = ElasticLoadBalancer.new(:adaptee => raw)
38
- remember(elb)
39
- Chef::Log.debug("Loaded #{elb}: #{elb.inspect}")
36
+ register raw unless raw.blank?
40
37
  end
41
38
  end
42
39
 
@@ -31,7 +31,6 @@ module Ironfan
31
31
  iss = new(:adaptee => cert)
32
32
  remember(iss, { :id => cert['ServerCertificateName'] })
33
33
  remember(iss, { :id => "#{ARN_PREFIX}:#{cert['Arn']}" })
34
- Chef::Log.debug("Loaded #{cert.inspect}")
35
34
  end
36
35
  end
37
36
 
@@ -37,7 +37,6 @@ module Ironfan
37
37
  def self.load!(cluster=nil)
38
38
  Ec2.connection.key_pairs.each do |keypair|
39
39
  register keypair unless keypair.blank?
40
- Chef::Log.debug("Loaded <%-15s %s>" % [handle, keypair.name])
41
40
  end
42
41
  end
43
42
 
@@ -127,7 +127,6 @@ module Ironfan
127
127
  else # never seen it
128
128
  remember machine
129
129
  end
130
- Chef::Log.debug("Loaded #{machine}")
131
130
  end
132
131
  end
133
132
 
@@ -19,7 +19,6 @@ module Ironfan
19
19
  result = Ec2.connection.describe_placement_groups
20
20
  result.body["placementGroupSet"].each do |group|
21
21
  register group unless group.blank?
22
- Chef::Log.debug("Loaded #{group.inspect}")
23
22
  end
24
23
  end
25
24
  end
@@ -33,9 +33,7 @@ module Ironfan
33
33
  #
34
34
  def self.load!(cluster=nil)
35
35
  Ec2.connection.security_groups.reject { |raw| raw.blank? }.each do |raw|
36
- sg = SecurityGroup.new(:adaptee => raw)
37
- remember(sg)
38
- Chef::Log.debug("Loaded #{sg}: #{sg.inspect}")
36
+ remember SecurityGroup.new(:adaptee => raw)
39
37
  end
40
38
  end
41
39
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ironfan
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.11.0
4
+ version: 4.11.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -381,7 +381,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
381
381
  version: '0'
382
382
  segments:
383
383
  - 0
384
- hash: -2459303337095261930
384
+ hash: 2795032387684139978
385
385
  required_rubygems_version: !ruby/object:Gem::Requirement
386
386
  none: false
387
387
  requirements: