Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@ec2instance: login issue #17

Open
curiousleo opened this issue Feb 27, 2014 · 0 comments
Open

@ec2instance: login issue #17

curiousleo opened this issue Feb 27, 2014 · 0 comments

Comments

@curiousleo
Copy link
Contributor

When I decorate a task with @ec2instance, it prompts me for a password for the current local user of my local host (instead of using the awsfab-ssh-user user and the default SSH key). I conducted a little test to compare the behaviour of a task decorated with @ec2instance(tags=...) started without --ec2tags and a similar task, not decorated with @ec2instance, but started with --ec2tags=...:

# fabfile.py
from fabric.api import task, run
from awsfabrictasks.decorators import ec2instance

@task
@ec2instance(tags={'Environment':'benchmark'})
def whoami_decorated():
    run('whoami')

@task
def whoami_not_decorated():
    run('whoami')

I would expect awsfab whoami_decorated and awsfab --ec2tags=Environment=benchmark whoami_not_decorated to produce the same results. Alas, awsfab whoami_decorated fails:

leo@localhost $ awsfab whoami_decorated                            
[ec2-IP1.us-west-2.compute.amazonaws.com] Executing task 'whoami_decorated'
[ec2-IP1.us-west-2.compute.amazonaws.com] run: whoami
[ec2-IP1.us-west-2.compute.amazonaws.com] Login password for 'leo': ^C

but awsfab --ec2tags=Environment=benchmark whoami_not_decorated succeeds:

leo@localhost $ awsfab --ec2tags=Environment=benchmark whoami_not_decorated
[[email protected]] Executing task 'whoami_not_decorated'
[[email protected]] run: whoami
[[email protected]] out: root

[[email protected]] Executing task 'whoami_not_decorated'
[[email protected]] run: whoami
[[email protected]] out: root

[[email protected]] Executing task 'whoami_not_decorated'
[[email protected]] run: whoami
[[email protected]] out: root

Done.
Disconnecting from [email protected]... done.
Disconnecting from [email protected]... done.
Disconnecting from [email protected]... done.

Now I'm wondering

  1. Why doesn't whoami_decorated use my SSH key and the awsfab-ssh-user (set to root)?
  2. Why do the two calls give different results?

[This is about @ec2instance just like issue #15, but it is concerned with how it works, not when it is executed, so I decided to open a new issue for it.]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant