Skip to content

Instantly share code, notes, and snippets.

@grantr grantr/gist:366418
Created Apr 14, 2010

Embed
What would you like to do?
# try to attach any of the available volumes
aws_ebs_volume "#{datanode_dir}_#{node[:hadoop][:cluster_name]}" do
aws_access_key aws['aws_access_key_id']
aws_secret_access_key aws['aws_secret_access_key']
size node[:hadoop][:datanode][:ebs_vol_size]
device ebs_vol_dev
volume_ids available_volumes.collect { |v| v['volume_id'] }
action :attach_first
provider "aws_ebs_volume"
end
# try to create a volume if none are available
aws_ebs_volume "#{datanode_dir}_#{node[:hadoop][:cluster_name]}" do
aws_access_key aws['aws_access_key_id']
aws_secret_access_key aws['aws_secret_access_key']
size node[:hadoop][:datanode][:ebs_vol_size]
device ebs_vol_dev
action [:create, :attach]
provider "aws_ebs_volume"
notifies :create, resources(:ruby_block => "store_#{datanode_dir}_#{node[:hadoop][:cluster_name]}_volid"), :immediately
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.