For AWS, the private key should be the PEM you download I believe. Beyond
that, you may also want to use the ec2 dynamic inventory script, rather
than hard-coding your hosts into a file. This will allow you to use things
like ec2 tags as groups and is generally a better way to reference your AWS
hosts.

On Thu, Dec 4, 2014 at 5:36 PM, Tanner Semerad <[email protected]>
wrote:

> I have an AWS machine that I want to run an Ansible playbook against. The
> playbook has been running great against my local Vagrant vm, but now I'm
> having trouble's running it against the AWS machine. I am able to ssh into
> the machine fine. Ex:
>
> ssh myserver
>
>
> I have a hosts file that looks like this:
>
> [production]
> myserver
>
>
> When I try to use ansible-playbook to run it, it fails:
> ansible-playbook -i hosts myplaybook.yml
>
> I tried specifying the --private-key to be the same one I used to ssh, but
> still doesn't work:
> ansible-playbook -i hosts --private-key=~/.ssh/id_rsa myplaybook.yml
>
>
> I also tried specifically setting the sudo user and setting
> --ask-sudo-pass but still had no luck.
>
> Is there something specific I should be looking for? I looked through the
> output of -vvvv, but nothing is standing out to me. I have 4 different
> private keys and it tried each of them, even when I specify which one to
> use. I'm running ansible 1.7.2 on a Macbook Pro.
>
>
>  --
> 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 [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/55845681-8a53-499b-a671-1bd4af3acf39%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/55845681-8a53-499b-a671-1bd4af3acf39%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAMFyvFg%3D3NuBqhJ4U6ftsp79ba4F2RA4k3eV_pU2Zm0TDAgumQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to