forward3d / cap-ec2

Capify-EC2 rewritten for Capistrano v3
MIT License
181 stars 118 forks source link

Add a 'debug' action to describe why a server was or was not matched #12

Closed andytinycat closed 9 years ago

andytinycat commented 10 years ago

Sometimes it's hard to debug why a server wasn't matched when you thought the tags were correct.

I envision it outputting a list of all instances in your account (filtered by regions if specified in your config), and explaining why an instance is or isn't matched alongside the discovered tags for that instance.

This will require doing the discovery in a different way when running this action - since the way we normally do discovery is using EC2 API filters.

It'll be quite slow for people with a lot of instances, but it's not going to be used except for trying to debug a discovery problem, so it's not a big deal.

(This is a reminder for me to implement this at some point.)

emilianochiozzi commented 9 years ago

Hi, this is exactly what I need now. My tags are correct but it is not matching. Is there a way to know why?

andytinycat commented 9 years ago

If it's not matching, the tags are not correct (unless there is a bug in Cap-EC2, which is entirely possible, but unlikely as it seems fairly widely used).

If you want, we can sanity check it together here.

Inside your config, :application must match the "Project" tag on your instances. The "Roles" tag must contain a role which is defined in your config; and the "Stages" tag must contain a stage which is defined in your config. Your deploy action must include the role(s) and stage(s) you have instances in.

Dump out the relevant parts of your config, and the tags on your instances (using ec2-describe-instances or similar), and let's have a look.

andytinycat commented 9 years ago

(The problem with a tool that does this is that it has to scan every instance in your account, and that seemed like a bad idea, and will take quite a long time.)

emilianochiozzi commented 9 years ago

Hi Andy, Maybe I am putting something wrong. Let me show you my files, I will appreciate if you can help me

deploy.rb [image: Imágenes integradas 1]

ec2.yml [image: Imágenes integradas 2]

production.rb [image: Imágenes integradas 3]

And this are my tags on AWS: [image: Imágenes integradas 4]

Any thoughts?? It all seems to be ok

Thanks!!

2015-03-17 16:28 GMT-03:00 Andy Sykes notifications@github.com:

(The problem with a tool that does this is that it has to scan every instance in your account, and that seemed like a bad idea, and will take quite a long time.)

— Reply to this email directly or view it on GitHub https://github.com/forward3d/cap-ec2/issues/12#issuecomment-82555243.

emilianochiozzi commented 9 years ago

One more things, I am using Amazon Virtual Private Cloud (Amazon VPC), not EC2. It has something to do with??

2015-03-17 16:40 GMT-03:00 Emiliano Chiozzi emilianochiozzi@gmail.com:

Hi Andy, Maybe I am putting something wrong. Let me show you my files, I will appreciate if you can help me

deploy.rb [image: Imágenes integradas 1]

ec2.yml [image: Imágenes integradas 2]

production.rb [image: Imágenes integradas 3]

And this are my tags on AWS: [image: Imágenes integradas 4]

Any thoughts?? It all seems to be ok

Thanks!!

2015-03-17 16:28 GMT-03:00 Andy Sykes notifications@github.com:

(The problem with a tool that does this is that it has to scan every instance in your account, and that seemed like a bad idea, and will take quite a long time.)

— Reply to this email directly or view it on GitHub https://github.com/forward3d/cap-ec2/issues/12#issuecomment-82555243.

emilianochiozzi commented 9 years ago

I have it working now :) Thanks!

2015-03-17 16:46 GMT-03:00 Emiliano Chiozzi emilianochiozzi@gmail.com:

One more things, I am using Amazon Virtual Private Cloud (Amazon VPC), not EC2. It has something to do with??

2015-03-17 16:40 GMT-03:00 Emiliano Chiozzi emilianochiozzi@gmail.com:

Hi Andy, Maybe I am putting something wrong. Let me show you my files, I will appreciate if you can help me

deploy.rb [image: Imágenes integradas 1]

ec2.yml [image: Imágenes integradas 2]

production.rb [image: Imágenes integradas 3]

And this are my tags on AWS: [image: Imágenes integradas 4]

Any thoughts?? It all seems to be ok

Thanks!!

2015-03-17 16:28 GMT-03:00 Andy Sykes notifications@github.com:

(The problem with a tool that does this is that it has to scan every instance in your account, and that seemed like a bad idea, and will take quite a long time.)

— Reply to this email directly or view it on GitHub https://github.com/forward3d/cap-ec2/issues/12#issuecomment-82555243.

andytinycat commented 9 years ago

Ok, I'll close this issue.