Hey guys,
This might be beyond the scope of this forum, but I’m hoping that maybe someone has enough know how with the Bedrock-Ansible setup, and some code samples I’m about to show you, and can tell me what I’m supposed to do here.
My problem is that I’m deploying to multiple Amazon EC2 instances in an Auto Scaling Group. Deploying to each one is a pain, as there might be as many as 2-6 (or more) instances running at once, with instances being terminated, or being spun up all the time. I’ve written many scripts and cron jobs to basically sync an s3 bucket with my /var/www/example.com folder so that each instance has the same one. That works ok, but any time I need to update something it can be a pain. Not to mention its far from fool proof.
One way to solve it would be to use Capistrano and an ec2-plugin that deploys to autoscaling groups automatically. The only problem is that Bedrock-Ansible is set up to use Ansible deploys, so it would kind of defeat the purpose of having to set up Capistrano.
Now Amazon has this great CodeDeploy tool that not only will solve the problem, but allows for so much more.
I’ve read on their site that integration with existing Ansible Playbooks should be simple enough, and they even gave me some sample configurations. The only problem is, I don’t have the slightest idea what to do with them. I only got to marginally understanding the ins and outs of Ansible, enough to get by and to the point I’m currently at, so right now my brain hurts looking through the sample configs below and trying to figure out where they would go.
Here is the page that is linked from the AWS CodeDeploy page for Ansible integration- aws-codedeploy-samples/conf-mgmt/ansible at master · aws-samples/aws-codedeploy-samples · GitHub
According to their site “If you already have a set of Ansible playbooks, but just need somewhere to run them, the template for Ansible and AWS CodeDeploy demonstrates how a couple of simple deployment hooks will ensure Ansible is available on the local deployment instance and run the given playbooks. Alternatively, if you already have a process for building and maintaining your inventory, there’s also an Ansible module that you can use to install and run the AWS CodeDeploy Agent.” (Product and service integrations with CodeDeploy - AWS CodeDeploy)
So… does anyone have any idea how I might want to set this up? Any help at all is always appreciated!
Thanks,
P.J.