Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-11-24 Thread Ben Whaley
Opened issue 383. Thanks again. https://github.com/ansible/ansible-modules-core/issues/383 - Ben On Monday, November 24, 2014 9:49:45 AM UTC-8, James Martin wrote: > > Hmm.. I wonder if we need to have the ec2_asg module to wait for the > healthCheckGracePeriod to expire before checking the in

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-11-24 Thread Ben Whaley
Oops, please use this link for the code instead. https://gist.github.com/bwhaley/eee6a0f61636862515aa On Monday, November 24, 2014 9:44:21 AM UTC-8, Ben Whaley wrote: > > Hi James, > > Thanks for your reply. > > Interesting point about the HealthCheckGracePeriod option. I wasn't aware > of its

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-11-24 Thread James Martin
Hmm.. I wonder if we need to have the ec2_asg module to wait for the healthCheckGracePeriod to expire before checking the instance health (assuming that it is an ELB health check type). Even with a health check grace period of one, there is a chance that the instance can become healthy in tha

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-11-24 Thread Ben Whaley
Hi James, Thanks for your reply. Interesting point about the HealthCheckGracePeriod option. I wasn't aware of its role here. I am indeed using it, in fact according to the docs it is a required option for ELB health checks. I had it set to 180, and I just tried it with lower values of 10 and 1

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-11-24 Thread James Martin
Ben, Thanks for the question.Considering this: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-add-elb-healthcheck.html, "Auto Scaling marks an instance unhealthy if the calls to the Amazon EC2 action DescribeInstanceStatus return any state other than running, the system

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-11-24 Thread Ben Whaley
Hi all, Sorry for resurrecting an old thread, but wanted to mention my experience thus far using ec2_asg & ec2_lc for code deploys. I'm more or less following the methods described in this helpful repo https://github.com/ansible/immutablish-deploys I believe the dual_asg role is accepted as th

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-09-11 Thread Scott Anderson
On Sep 11, 2014, at 3:26 PM, James Martin wrote: > I think we're probably going to move to a system that uses a tier of proxies > and two ELBs. That way we can update the idle ELB, change out the AMIs, and > bring the updated ELB up behind an alternate domain for the blue-green > testing. Then

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-09-11 Thread James Martin
On Thu, Sep 11, 2014 at 2:51 PM, Scott Anderson wrote: > > The general problem with this approach is that it doesn’t work well for > blue-green deployments, nor if the new code can’t coexist with the > currently running code. > Yep, understood. > I think we’re probably going to move to a syste

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-09-11 Thread Scott Anderson
On Sep 11, 2014, at 2:26 PM, James Martin wrote: > Scott, > > Neat to see someone else's approach. The "fast method" you have there > probably could be worked into what's been merged. Another approach (maybe > simpler) would just be stand up a parallel ASG with the new AMI. The general

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-09-11 Thread James Martin
Scott, Neat to see someone else's approach. The "fast method" you have there probably could be worked into what's been merged. Another approach (maybe simpler) would just be stand up a parallel ASG with the new AMI. I like making the AutoScale Group do the instance provisioning, versus your app

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-09-11 Thread Scott Anderson
For comparison: https://github.com/scottanderson42/ansible/blob/ec2_vol/library/cloud/ec2_asg_cycle Still a work in progress (as you should be able to tell from the logging statements :-), but we've been using it in production for several months and it's (now) battle tested. The "Slow" method i

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-09-11 Thread Scott Anderson
Wow, I wish I'd seen this conversation earlier. I have a module that does this, using something similar to option 1. My module respects multi-AZ load balancers and results in a completely transparent deploy, *so long as* the code in the new AMI can run alongside the old code. There's a start of

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-09-11 Thread Michael DeHaan
I definitely would like to see the ec2 guide upgraded to teach more ec2 concepts. It's largely a holdover from the very early days, and needs to show some basics like using add_host together with ec2 (as is shown elsewhere) but also some more idioms. I'd be quite welcome to see it mostly rewritte

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-09-11 Thread Will Thames
I have some relatively extensive documentation on ec2 - it might be a little too over the top for the user guide. http://willthames.github.io/2014/03/17/ansible-layered-configuration-for-aws.html If you want me to incorporate any or all of it into the user guide, I'd be happy to do so. I haven'

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-09-10 Thread James Martin
Just wanted to note that this code has now been merged into ec2_asg in Ansible 1.8 devel branch, and the docs are updated with examples. Thanks, James On Mon, Sep 8, 2014 at 1:21 PM, Michael DeHaan wrote: > > > On Sun, Sep 7, 2014 at 5:48 PM, James Martin wrote: > >> Michael, >> >> The reason

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-09-08 Thread Michael DeHaan
On Sun, Sep 7, 2014 at 5:48 PM, James Martin wrote: > Michael, > > The reason for having both was to spur this very discussion. :). Option 1 > is a bit more complicated but more transparent, option 2 is much easier but > less transparent. I'm more fond of option 2, and happy to make it the only

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-09-07 Thread James Martin
Daniel, Yep, Option 2 is designed to work with replace_batch_size. Currently it's mutually exclusive with "replace_instances", but I think if we decide to go with Option 2, I could make replace_instances work. I think it might be desirable to replace all instances or just a few, but still hav

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-09-07 Thread James Martin
Michael, The reason for having both was to spur this very discussion. :). Option 1 is a bit more complicated but more transparent, option 2 is much easier but less transparent. I'm more fond of option 2, and happy to make it the only one. BTW, are we talking about the docs or the actual feature?

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-09-07 Thread Daniel Langer
FWIW I like the cleanliness of Option 2 - would it still support the options like replace_batch_size? -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansi

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-09-07 Thread Michael DeHaan
Hi James, Thanks! In reading the PR examples section, I'm curious why we might show Option 1 if Option 2 is much cleaner and would be interested in details. Also, quick question - it's replacing all instances, but what's it replacing them *with* ? Perhaps this is something we should show as wel

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-09-07 Thread James Martin
Dan, I've been tinkering with this process for quite a while and have made a pull request to ansible core that I believe does what you are looking for: https://github.com/ansible/ansible/pull/8901 As Michael stated, we will be releasing a blog post that's going to go more in depth in describing

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-09-07 Thread Michael DeHaan
Hi, James Martin is working on a 2-3 part blog post on *exactly* this subject, which I believe we're going to be posting this week, which shows a couple of ways to do it. I've included him on this mailing list thread if he wants to share some cliff-notes. --Michael On Sun, Sep 7, 2014 at 2:0

[ansible-project] EC2 Rolling Deploy with an ASG

2014-09-07 Thread Daniel Langer
Hello, I'm trying to use Ansible to do a rolling deploy against an ELB linked to an auto-scaling group (ASG), using a pre-baked AMI. My ideal process would go something like this 1. Get the current membership of the ASG 2. Update the launch configuration for the ASG 3. For each member: 3a. Cr