Permalink
Browse files

Allow per-ephemeral-disk options using :disks attribute

  • Loading branch information...
1 parent 5198478 commit c18b4f827295b71fa0b0328cd095bc851909cd1d @nickmarden nickmarden committed Jan 29, 2013
Showing with 15 additions and 1 deletion.
  1. +7 −1 lib/ironfan/dsl/ec2.rb
  2. +8 −0 spec/ironfan/ec2/cloud_provider_spec.rb
View
@@ -104,7 +104,13 @@ def implied_volumes
mount_options 'defaults,noatime'
tags({:bulk => true, :local => true, :fallback => true})
end
- ephemeral.receive! mount_ephemerals
+ ephemeral_attrs = mount_ephemerals.clone
+ if ephemeral_attrs.has_key?(:disks)
+ disk_attrs = mount_ephemerals[:disks][idx] || { }
+ ephemeral_attrs.delete(:disks)
+ ephemeral_attrs.merge!(disk_attrs)
+ end
+ ephemeral.receive! ephemeral_attrs
result << ephemeral
end
result
@@ -13,6 +13,10 @@
facet :web do
instances 3
+ cloud(:ec2) do
+ flavor 'm1.small'
+ mount_ephemerals({ :disks => { 0 => { :mount_point => '/data' } } })
+ end
end
end
@@ -30,6 +34,10 @@
it 'should have one cloud provider, EC2' do
@facet.servers[0].clouds.keys.should == [ :ec2 ]
end
+
+ it 'should have its first ephemeral disk mounted at /data' do
+ @facet.servers[0].implied_volumes[1].mount_point.should == '/data'
+ end
end
end

0 comments on commit c18b4f8

Please sign in to comment.