Skip to content

Instantly share code, notes, and snippets.

@trobrock
Last active December 18, 2015 03:08
Show Gist options
  • Save trobrock/5715767 to your computer and use it in GitHub Desktop.
Save trobrock/5715767 to your computer and use it in GitHub Desktop.
include_recipe "aws"
include_recipe "ec2-consistent-snapshot"
ruby_block "get attached ebs volumes" do
block do
# volumes = Opscode::Aws::Ec2.ec2.describe_volumes.detect{ |v| v[:aws_instance_id] == instance_id }
run_context["ebs_volumes"] = ["vol-abcd123"]
end
end
ec2_consistent_snapshot_wrapper "/usr/bin/mysql_snapshot" do
freeze_filesystem "/var/lib/mysql"
volumes run_context["ebs_volumes"]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment