@Greg - Have a look at my Vagrant box templates which include using Ansible 
for all provisioning. May be able to get you headed down the right path.

https://github.com/mrlesmithjr/vagrant-box-templates

Specifically bootstrap.yml 
<https://github.com/mrlesmithjr/vagrant-box-templates/blob/master/bootstrap.yml>



On Monday, June 6, 2016 at 3:16:17 PM UTC-4, Greg Evans wrote:
>
> Hey,
>
> I am probably missing something very obvious, but here is my situation
>
> I use Vagrant to spin up some VMs, to make it easy, it is like this:
>
> ansible VM
> host1 VM
> host2 VM
> hostN VM
>
> My goal is that I want ansible installed on the ansible VM within Vagrant 
> (virtualbox), and I want to kick off my playbook and have ansible install 
> all the goodies on host1-n.
>
> So, what works, is that ansible gets installed and runs, very simple to do 
> there, what doesn't work is connecting to any of the other Vagrant VMs with 
>
> fatal: [192.168.50.101]: UNREACHABLE! => {"changed": false, "msg": "Failed 
> to connect to the host via ssh.", "unreachable": true}
>
> I have exactly no idea what I am doing wrong here, but obviously it is 
> something with ssh :) I have tried using the private_key from the 
> virtualmachine in a place where ansible can see it, and creating a 
> host_vars directory with files like
>
> filename: 192.168.50.20
> content: ansible_ssh_private_key_file: 
> /home/vargrant/sync/.vagrant/machines/host1/virtualbox/private_key
>
> but alas, that doesn't work either. Any help would be greatly appreciated 
> as I have hit a brick wall.
>
> To note, my ansible playbook works fine on the vm it is running on, named 
> "ansible", just can't connect to the other vms, even though I can ping them 
> and ssh to them manually using the standard vagrant username/pass from 
> within the ansible machine
>
>
>

-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a96ef00d-5bcd-4e11-9c3b-8aaa016d485d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to