ironfan 6.0.9 → 6.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/ironfan.gemspec CHANGED
@@ -24,10 +24,9 @@ Gem::Specification.new do |gem|
24
24
  gem.add_dependency('unf', '0.1.3')
25
25
  gem.add_dependency('excon', '0.32.1')
26
26
  gem.add_dependency('formatador', '0.2.4')
27
- gem.add_dependency('gorillib', '0.5.0')
27
+ gem.add_dependency('gorillib', '~> 0.6.0')
28
28
  gem.add_dependency('rbvmomi', '1.8.1')
29
29
  gem.add_dependency('diff-lcs', '1.2.5')
30
- gem.add_dependency('json', '1.5.4')
31
30
 
32
31
  gem.add_development_dependency('bundler', '~> 1.0')
33
32
 
@@ -42,10 +42,6 @@ module Ironfan
42
42
  name
43
43
  end
44
44
 
45
- def full_cluster_name
46
- full_name
47
- end
48
-
49
45
  def full_name
50
46
  "#{realm_name}-#{name}"
51
47
  end
@@ -110,7 +110,7 @@ module Ironfan
110
110
  discovery = {discovers: keys.reverse.inject(compute.realm_name){|hsh,key| {key => hsh}}}
111
111
  (compute.facet_role || compute.cluster_role).override_attributes(discovery)
112
112
 
113
- client_group_v = compute.full_cluster_name
113
+ client_group_v = compute.full_name
114
114
  server_group_v = "#{realm_name}-#{server_cluster}"
115
115
 
116
116
  group_edge(compute, client_group_v, :authorized_by_group, server_group_v)
@@ -325,23 +325,23 @@ Chef::Config[:ec2_flavor_info].merge!({
325
325
  'c1.xlarge' => { :price => 0.580, :bits => 64, :ram => 7168, :cores => 8, :core_size => 2.5, :inst_disks => 4, :inst_disk_size => 420, :ephemeral_volumes => 4, :ebs_optimizable => 1000, },
326
326
  'm1.xlarge' => { :price => 0.480, :bits => 64, :ram => 15360, :cores => 4, :core_size => 2.0, :inst_disks => 4, :inst_disk_size => 420, :ephemeral_volumes => 4, :ebs_optimizable => 1000, },
327
327
  'm3.2xlarge' => { :price => 0.900, :bits => 64, :ram => 30720, :cores => 8, :core_size => 3.25, :inst_disks => 2, :inst_disk_size => 80, :ephemeral_volumes => 2, :ebs_optimizable => 1000, },
328
- 'm2.2xlarge' => { :price => 0.820, :bits => 64, :ram => 35021, :cores => 4, :core_size => 3.25, :inst_disks => 1, :inst_disk_size => 850, :ephemeral_volumes => 1, :ebs_optimizable => 500, },
328
+ 'm2.2xlarge' => { :price => 0.820, :bits => 64, :ram => 35021, :cores => 4, :core_size => 3.25, :inst_disks => 1, :inst_disk_size => 850, :ephemeral_volumes => 2, :ebs_optimizable => 500, },
329
329
  'm2.4xlarge' => { :price => 1.640, :bits => 64, :ram => 70042, :cores => 8, :core_size => 3.25, :inst_disks => 2, :inst_disk_size => 840, :ephemeral_volumes => 2, :ebs_optimizable => 1000, },
330
330
  'cc2.8xlarge' => { :price => 2.400, :bits => 64, :ram => 61952, :cores =>32, :core_size => 2.75, :inst_disks => 4, :inst_disk_size => 840, :ephemeral_volumes => 4, :placement_groupable => true, :virtualization => 'hvm' },
331
331
  'cg1.4xlarge' => { :price => 2.100, :bits => 64, :ram => 23040, :cores =>16, :core_size => 2.09375, :inst_disks => 2, :inst_disk_size => 840, :ephemeral_volumes => 2, :placement_groupable => true, :virtualization => 'hvm' },
332
- 'c3.large' => { :price => 0.150, :bits => 64, :ram => 3840, :cores => 2, :core_size => 3.5, :inst_disks => 2, :inst_disk_size => 16, :ephemeral_volumes => 2, :placement_groupable => true, :virtualization => 'hvm', :ebs_optimizable => 1000 },
333
- 'c3.xlarge' => { :price => 0.300, :bits => 64, :ram => 7680, :cores => 4, :core_size => 3.5, :inst_disks => 2, :inst_disk_size => 40, :ephemeral_volumes => 2, :placement_groupable => true, :virtualization => 'hvm', :ebs_optimizable => 1000 },
334
- 'c3.2xlarge' => { :price => 0.600, :bits => 64, :ram => 15360, :cores => 8, :core_size => 3.5, :inst_disks => 2, :inst_disk_size => 80, :ephemeral_volumes => 2, :placement_groupable => true, :virtualization => 'hvm', :ebs_optimizable => 1000 },
335
- 'c3.4xlarge' => { :price => 1.200, :bits => 64, :ram => 30720, :cores => 16, :core_size => 3.4375, :inst_disks => 2, :inst_disk_size => 160, :ephemeral_volumes => 2, :placement_groupable => true, :virtualization => 'hvm', :ebs_optimizable => 1000 },
332
+ 'c3.large' => { :price => 0.150, :bits => 64, :ram => 3840, :cores => 2, :core_size => 3.5, :inst_disks => 2, :inst_disk_size => 16, :ephemeral_volumes => 2, :placement_groupable => true, :virtualization => 'hvm', :ebs_opizable => 1000 },
333
+ 'c3.xlarge' => { :price => 0.300, :bits => 64, :ram => 7680, :cores => 4, :core_size => 3.5, :inst_disks => 2, :inst_disk_size => 40, :ephemeral_volumes => 2, :placement_groupable => true, :virtualization => 'hvm', :ebs_opizable => 1000 },
334
+ 'c3.2xlarge' => { :price => 0.600, :bits => 64, :ram => 15360, :cores => 8, :core_size => 3.5, :inst_disks => 2, :inst_disk_size => 80, :ephemeral_volumes => 2, :placement_groupable => true, :virtualization => 'hvm', :ebs_opizable => 1000 },
335
+ 'c3.4xlarge' => { :price => 1.200, :bits => 64, :ram => 30720, :cores => 16, :core_size => 3.4375, :inst_disks => 2, :inst_disk_size => 160, :ephemeral_volumes => 2, :placement_groupable => true, :virtualization => 'hvm', :ebs_opizable => 1000 },
336
336
  'c3.8xlarge' => { :price => 2.400, :bits => 64, :ram => 61440, :cores => 32, :core_size => 3.375, :inst_disks => 2, :inst_disk_size => 320, :ephemeral_volumes => 2, :placement_groupable => true, :virtualization => 'hvm' },
337
337
  'hs1.8xlarge' => { :price => 4.600, :bits => 64, :ram => 119808, :cores => 16, :core_size => 2.1875, :inst_disks => 24, :inst_disk_size => 2048, :ephemeral_volumes => 24, :placement_groupable => true, :virtualization => 'hvm' },
338
338
  'cr1.8xlarge' => { :price => 3.500, :bits => 64, :ram => 249856, :cores => 32, :core_size => 2.75, :inst_disks => 2, :inst_disk_size => 120, :ephemeral_volumes => 2, :placement_groupable => true, :virtualization => 'hvm' },
339
- 'i2.xlarge' => { :price => 0.853, :bits => 64, :ram => 31232, :cores => 4, :core_size => 3.5, :inst_disks => 1, :inst_disk_size => 800, :ephemeral_volumes => 1, :placement_groupable => true, :virtualization => 'hvm', :ebs_optimizable => 500 },
340
- 'i2.2xlarge' => { :price => 1.705, :bits => 64, :ram => 62464, :cores => 8, :core_size => 3.375, :inst_disks => 2, :inst_disk_size => 800, :ephemeral_volumes => 2, :placement_groupable => true, :virtualization => 'hvm', :ebs_optimizable => 1000 },
341
- 'i2.4xlarge' => { :price => 3.410, :bits => 64, :ram => 124928, :cores => 16, :core_size => 3.3125, :inst_disks => 4, :inst_disk_size => 800, :ephemeral_volumes => 4, :placement_groupable => true, :virtualization => 'hvm', :ebs_optimizable => 1000 },
339
+ 'i2.xlarge' => { :price => 0.853, :bits => 64, :ram => 31232, :cores => 4, :core_size => 3.5, :inst_disks => 1, :inst_disk_size => 800, :ephemeral_volumes => 1, :placement_groupable => true, :virtualization => 'hvm', :ebs_optimized => 500 },
340
+ 'i2.2xlarge' => { :price => 1.705, :bits => 64, :ram => 62464, :cores => 8, :core_size => 3.375, :inst_disks => 2, :inst_disk_size => 800, :ephemeral_volumes => 2, :placement_groupable => true, :virtualization => 'hvm', :ebs_optimized => 1000 },
341
+ 'i2.4xlarge' => { :price => 3.410, :bits => 64, :ram => 124928, :cores => 16, :core_size => 3.3125, :inst_disks => 4, :inst_disk_size => 800, :ephemeral_volumes => 4, :placement_groupable => true, :virtualization => 'hvm', :ebs_optimized => 1000 },
342
342
  'i2.8xlarge' => { :price => 6.820, :bits => 64, :ram => 249856, :cores => 32, :core_size => 3.25, :inst_disks => 8, :inst_disk_size => 800, :ephemeral_volumes => 8, :placement_groupable => true, :virtualization => 'hvm' },
343
- 'g2.2xlarge' => { :price => 0.650, :bits => 64, :ram => 15360, :cores => 8, :core_size => 3.25, :inst_disks => 1, :inst_disk_size => 60, :ephemeral_volumes => 1, :placement_groupable => true, :virtualization => 'hvm', :ebs_optimizable => 1000 },
344
- 'hi1.4xlarge' => { :price => 3.100, :bits => 64, :ram => 61952, :cores => 16, :core_size => 2.1875, :inst_disks => 2, :inst_disk_size => 1024, :ephemeral_volumes => 2, :placement_groupable => true, :virtualization => 'hvm', :ebs_optimizable => 1000 },
343
+ 'g2.2xlarge' => { :price => 0.650, :bits => 64, :ram => 15360, :cores => 8, :core_size => 3.25, :inst_disks => 1, :inst_disk_size => 60, :ephemeral_volumes => 1, :placement_groupable => true, :virtualization => 'hvm', :ebs_optimized => 1000 },
344
+ 'hi1.4xlarge' => { :price => 3.100, :bits => 64, :ram => 61952, :cores => 16, :core_size => 2.1875, :inst_disks => 2, :inst_disk_size => 1024, :ephemeral_volumes => 2, :placement_groupable => true, :virtualization => 'hvm', :ebs_optimized => 1000 },
345
345
  })
346
346
 
347
347
  Chef::Config[:ec2_image_info] ||= {}
@@ -27,12 +27,8 @@ module Ironfan
27
27
  servers.to_a + components.to_a
28
28
  end
29
29
 
30
- def full_cluster_name
31
- "#{realm_name}-#{cluster_name}"
32
- end
33
-
34
30
  def full_name
35
- "#{full_cluster_name}-#{name}"
31
+ "#{realm_name}-#{cluster_name}-#{name}"
36
32
  end
37
33
  end
38
34
  end
@@ -170,10 +170,10 @@ module Ironfan
170
170
  hsh.delete(:_type)
171
171
  hsh.delete(:ssh_user)
172
172
  #hsh[:security_groups] = Hash[hsh[:security_groups].map{|x| [x.fetch(:name), x]}]
173
- hsh[:components] = Hash[hsh.fetch(:components).map do |component|
174
- [component.fetch(:name), component]
173
+ hsh[:components] = Hash[hsh[:components].to_a.map do |component|
174
+ [component[:name].to_s, component]
175
175
  end]
176
- hsh[:run_list] = hsh.fetch(:run_list).map do |x|
176
+ hsh[:run_list] = hsh[:run_list].to_a.map do |x|
177
177
  x.end_with?(']') ? x : "recipe[#{x}]"
178
178
  end
179
179
  end)
@@ -11,13 +11,6 @@ module Ironfan
11
11
  magic :formattable, :boolean, :default => false
12
12
  magic :fstype, String, :default => 'xfs'
13
13
  magic :in_raid, String
14
-
15
- # The number of I/O operations per second (IOPS) that the volume supports.
16
- # valid range: 500-4000
17
- # Only Provisioned IOPS (SSD, type io1) drives support
18
- # this. These volumes should be with EBS-optimized machines.
19
- magic :iops, Integer
20
-
21
14
  magic :keep, :boolean, :default => true
22
15
  magic :mount_dump, String
23
16
  magic :mount_pass, String
@@ -31,12 +24,6 @@ module Ironfan
31
24
  magic :snapshot_name, String
32
25
  magic :tags, Hash, :default => {}
33
26
 
34
- # valid types:
35
- # gp2 = General Purpose 2
36
- # io1 = Provisioned IOPS
37
- # standard = Magnetic volumes
38
- magic :type, String
39
-
40
27
  VOLUME_IDS ||= {}
41
28
  VOLUME_IDS.merge!({
42
29
  :blank_xfs => 'snap-d9c1edb1',
@@ -8,11 +8,11 @@ module Ironfan
8
8
  :connection, :connection=, :created_at, :created_at=,
9
9
  :delete_on_termination, :delete_on_termination=, :destroy, :device,
10
10
  :device=, :dup_attributes!, :force_detach, :id, :id=, :identity,
11
- :identity=, :iops, :merge_attributes, :missing_attributes, :new_record?,
11
+ :identity=, :merge_attributes, :missing_attributes, :new_record?,
12
12
  :ready?, :reload, :requires, :requires_one, :save, :server,
13
13
  :server=, :server_id, :server_id=, :size, :size=, :snapshot,
14
14
  :snapshot_id, :snapshot_id=, :snapshots, :state, :state=,
15
- :symbolize_keys, :tags, :tags=, :type, :wait_for,
15
+ :symbolize_keys, :tags, :tags=, :wait_for,
16
16
  :to => :adaptee
17
17
  field :dsl_volume, Ironfan::Dsl::Volume
18
18
 
@@ -48,7 +48,12 @@ module Ironfan
48
48
  #
49
49
  # Discovery
50
50
  #
51
- def self.load!(cluster=nil)
51
+ def self.load!(cluster = nil)
52
+ load_once!
53
+ end
54
+
55
+ def self.load_once!
56
+ return if @loaded
52
57
  Ec2.connection.volumes.each do |vol|
53
58
  next if vol.blank?
54
59
  next if %w[deleting deleted error].include?(vol.state.to_s)
@@ -62,6 +67,7 @@ module Ironfan
62
67
  remember ebs
63
68
  end
64
69
  end
70
+ @loaded = true
65
71
  end
66
72
 
67
73
  def receive_adaptee(obj)
@@ -114,7 +114,12 @@ module Ironfan
114
114
  #
115
115
  # Discovery
116
116
  #
117
- def self.load!(cluster=nil)
117
+ def self.load!(cluster = nil)
118
+ load_once!
119
+ end
120
+
121
+ def self.load_once!
122
+ return if @loaded
118
123
  Ec2.connection.servers.each do |fs|
119
124
  machine = new(:adaptee => fs)
120
125
  if (not machine.created?)
@@ -128,6 +133,7 @@ module Ironfan
128
133
  remember machine
129
134
  end
130
135
  end
136
+ @loaded = true
131
137
  end
132
138
 
133
139
  def receive_adaptee(obj)
@@ -265,14 +271,11 @@ module Ironfan
265
271
  end.compact.map(&:name)
266
272
 
267
273
  if cloud.flavor_info[:placement_groupable]
268
- description[:placement_group] = cloud.placement_group.to_s
269
- elsif cloud.placement_group
270
- Chef::Application.fatal!("A placement group was set but #{cloud.flavor} does not support placement!")
274
+ ui.warn "1.3.1 and earlier versions of Fog don't correctly support placement groups, so your nodes will land willy-nilly. We're working on a fix"
275
+ description[:placement] = { 'groupName' => cloud.placement_group.to_s }
271
276
  end
272
277
  if cloud.flavor_info[:ebs_optimizable]
273
278
  description[:ebs_optimized] = cloud.ebs_optimized
274
- elsif cloud.ebs_optimized
275
- Chef::Application.fatal!("ebs_optimized set but #{cloud.flavor} does not support ebs optimization!")
276
279
  end
277
280
  description
278
281
  end
@@ -293,8 +296,6 @@ module Ironfan
293
296
  end
294
297
  hsh['Ebs.SnapshotId'] = volume.snapshot_id if volume.snapshot_id.present?
295
298
  hsh['Ebs.VolumeSize'] = volume.size.to_s if volume.size.present?
296
- hsh['Ebs.VolumeType'] = volume.type if volume.type.present?
297
- hsh['Ebs.Iops'] = volume.iops if volume.type == 'io1'
298
299
  hsh['Ebs.DeleteOnTermination'] = (not volume.keep).to_s
299
300
  else next
300
301
  end
@@ -204,6 +204,8 @@ module Ironfan
204
204
  server.security_group computer.server.realm_name
205
205
  realm_group = server.security_group cluster_name
206
206
  realm_group.authorized_by_group realm_group.name
207
+ facet_name = "#{computer.server.realm_name}-#{computer.server.cluster_name}-#{computer.server.facet_name}"
208
+ server.security_group facet_name
207
209
  end
208
210
 
209
211
  # Try an authorization, ignoring duplicates (this is easier than correlating).
@@ -192,6 +192,8 @@ module Ironfan
192
192
  server.security_group computer.server.realm_name
193
193
  realm_group = server.security_group cluster_name
194
194
  realm_group.authorized_by_group realm_group.name
195
+ facet_name = "#{computer.server.realm_name}-#{computer.server.cluster_name}-#{computer.server.facet_name}"
196
+ server.security_group facet_name
195
197
  end
196
198
 
197
199
  # Try an authorization, ignoring duplicates (this is easier than correlating).
@@ -1,3 +1,3 @@
1
1
  module Ironfan
2
- VERSION = '6.0.9'
2
+ VERSION = '6.1.0'
3
3
  end
@@ -197,7 +197,7 @@ describe Ironfan::Dsl::Component do
197
197
  end
198
198
 
199
199
  it 'correctly sets the server cluster even when the client and server facets differ' do
200
- bam_wak_group = Ironfan.realm(:wap).cluster(:bam).facet(:wak).security_group('wap-bam')
200
+ bam_wak_group = Ironfan.realm(:wap).cluster(:bam).facet(:wak).security_group('wap-bam-wak')
201
201
  bam_wak_group.group_authorized_by.should include('wap-bop')
202
202
  end
203
203
 
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: 6.0.9
4
+ version: 6.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-29 00:00:00.000000000 Z
12
+ date: 2014-04-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: chef
@@ -96,17 +96,17 @@ dependencies:
96
96
  requirement: !ruby/object:Gem::Requirement
97
97
  none: false
98
98
  requirements:
99
- - - '='
99
+ - - ~>
100
100
  - !ruby/object:Gem::Version
101
- version: 0.5.0
101
+ version: 0.6.0
102
102
  type: :runtime
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
- - - '='
107
+ - - ~>
108
108
  - !ruby/object:Gem::Version
109
- version: 0.5.0
109
+ version: 0.6.0
110
110
  - !ruby/object:Gem::Dependency
111
111
  name: rbvmomi
112
112
  requirement: !ruby/object:Gem::Requirement
@@ -139,22 +139,6 @@ dependencies:
139
139
  - - '='
140
140
  - !ruby/object:Gem::Version
141
141
  version: 1.2.5
142
- - !ruby/object:Gem::Dependency
143
- name: json
144
- requirement: !ruby/object:Gem::Requirement
145
- none: false
146
- requirements:
147
- - - '='
148
- - !ruby/object:Gem::Version
149
- version: 1.5.4
150
- type: :runtime
151
- prerelease: false
152
- version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
- requirements:
155
- - - '='
156
- - !ruby/object:Gem::Version
157
- version: 1.5.4
158
142
  - !ruby/object:Gem::Dependency
159
143
  name: bundler
160
144
  requirement: !ruby/object:Gem::Requirement
@@ -332,12 +316,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
332
316
  - - ! '>='
333
317
  - !ruby/object:Gem::Version
334
318
  version: '0'
319
+ segments:
320
+ - 0
321
+ hash: 1983446031386045195
335
322
  required_rubygems_version: !ruby/object:Gem::Requirement
336
323
  none: false
337
324
  requirements:
338
325
  - - ! '>='
339
326
  - !ruby/object:Gem::Version
340
327
  version: '0'
328
+ segments:
329
+ - 0
330
+ hash: 1983446031386045195
341
331
  requirements: []
342
332
  rubyforge_project:
343
333
  rubygems_version: 1.8.25