Open MauriceSchoenmakers opened 14 years ago
I did it with the aws chef cookbook
aws_ebs_volume "mysql_data_volume" do
provider "aws_ebs_volume"
aws_access_key node[:awskeys][:access]
aws_secret_access_key node[:awskeys][:secret]
volume_id node[:apricoserver][:db][:ebs_volume]
availability_zone "us-east-1b"
device "/dev/sdh"
action :attach
end
You need to put your AWS keys into the cloud though and manually create the volume in the AWS web page. Then you can use the mount resource.
# This works as long as you have previously formatted
# the device as ext3 using
#
# mkfs.ext3 /dev/sdh
#
# Need some magic to do this automatically.
#
#
mount "/var/local/ebs" do
device "/dev/sdh"
options "rw noatime"
fstype "ext3"
action [ :enable, :mount ]
# Do not execute if its already mounted
not_if "cat /proc/mounts | grep /var/local"
end
creating and mounting EBS volumes (via snapshots) is not yet supported but needed for real world applications like mysql server.