Re: [ansible-project] attempt to ansible -m ping into vagrant box fails

35 views
Skip to first unread message
Message has been deleted

Dick Davies

unread,
Sep 25, 2015, 9:35:26 AM9/25/15
to ansible list
what do you see when you rerun with '-vvvv' as the error suggests?

On 25 September 2015 at 14:30, DEBORAH AKUOKO <ewurama.mi...@gmail.com> wrote:
I have a vagrant vm which i can successfully ping and ssh into from my host machine and vice versa.
But I am not able to run ansible ping to the vagrant box, 
nether an i able to run my playbook which connects to the vagrant box.

Please find the snapshot attached.





--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/097d54de-f0a0-481a-ab61-f546acb7e937%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

DEBORAH AKUOKO

unread,
Sep 25, 2015, 9:50:45 AM9/25/15
to ansible...@googlegroups.com
Hello Dick,

Please see attached the screenshot of what I get when i rerun with -vvv.
I seem to get the same permission denied error, but this time with some extra details in blue font.













--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/RWjHC0gyXPA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.

To post to this group, send email to ansible...@googlegroups.com.
after rerun with - vvv.png

Dick Davies

unread,
Sep 25, 2015, 12:04:28 PM9/25/15
to ansible list
OK, so that shows you the exact SSH command Ansible is running for you.
If you were to paste that blue text into a shell you'll likely get the same error
(could be an issue with the VM or your client side).

You didn't say how you're sshing into the VM, and it seems like you're pushing up
a pubkey beforehand. So it's not an approach I'm familiar with.

That said we use Vagrant extensively, just to get started on building out a playbook.
So a few pointers that may help.


1. in your Vagrantfile it's worth setting "c.ssh.insert_key = false" to stop Vagrant
    generating a new public key everytime the VM boots. 
    This is down to a 'feature' they added to newer Vagrants

2. 'vagrant ssh foo' is generally not the same as 'ssh vagrant@foo' - seems like
    Vagrant uses a different interface to SSH in and provision things (this may
    just be images I've used but it's really confusing if you aren't aware)

3. With the c.ssh.insert_key setting fixed as in 1., all you normally need is to
    set a couple of vars in your inventory so Ansible will use the key and user
    that Vagrant expects

------------------------------------
$ head vagrant/hosts
[all:vars]
ansible_ssh_user=vagrant
ansible_ssh_private_key_file=~/.vagrant.d/insecure_private_key
------------------------------------

It might help to look at a working example, one of my public playbooks is
here if that helps:



Reply all
Reply to author
Forward
Message has been deleted
0 new messages