- From: "Julian C. Dunn" <
>
- To:
- Subject: [chef] Re: How to format a volume and mount after using aws_ebs_volume
- Date: Sat, 22 Jun 2013 21:57:27 -0400
On Sat, Jun 22, 2013 at 12:24 AM, David Montgomery
<
" target="_blank">
> wrote:
Hi,
I used the below to attach a volume to an ec2 isntances.
aws_ebs_volume "db_ebs_volume" do
aws_access_key aws['aws_access_key_id']
aws_secret_access_key aws['aws_secret_access_key']
size 50
device "/dev/sdi"
action [ :create, :attach ]
end
I need to now format the volume
create a directory called /data
then mount the the volume with the /data directory.
What is the best chefonic method to achive this is a recipe?
I have tried this before, and I called out to shell to do invoke mkfs. Problem arises when you want ext3/ext4 -- the ext3utils don't give you a way to test whether a volume is formatted before you reformat it :-/ mkfs.xfs will, however, return a non-zero exit code that you can use.
For mounting, you can use the built-in mount resource.
http://docs.opscode.com/resource_mount.html - Julian
--
[ Julian C. Dunn <
" target="_blank">
> * Sorry, I'm ]
[ WWW:
http://www.aquezada.com/staff/julian * only Web 1.0 ]
[ gopher://
sdf.org/1/users/keymaker/ * compliant! ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]
Archive powered by MHonArc 2.6.16.