vagrant and ansible not working on osx mountain lion

I’ve installed virtual box, vagrant and ansible from http://www.pyrosoft.co.uk/blog/2012/06/26/installing-ansible-on-osx-lion/

But I can’t get anything to work. I can start vagrant and ssh in but I can’t get to any urls.

I don’t have /etc/ansible/hosts, is this supposed to be created on install?

Running ansible all -m ping I get these errors

192.168.0.62 | FAILED => SSH encountered an unknown error during the connection. We recommend you re-run the command using -vvvv, which will enable SSH debugging output to help diagnose the issue

and with -vvvv

192.168.0.62 | FAILED => SSH encountered an unknown error. The output was:
OpenSSH_5.9p1, OpenSSL 0.9.8y 5 Feb 2013
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: auto-mux: Trying existing master
debug1: Control socket “/Users/Derek/.ansible/cp/ansible-ssh-192.168.0.62-22-Derek” does not exist
debug2: ssh_connect: needpriv 0
debug1: Connecting to 192.168.0.62 [192.168.0.62] port 22.
debug2: fd 3 setting O_NONBLOCK
debug1: connect to address 192.168.0.62 port 22: Operation timed out
ssh: connect to host 192.168.0.62 port 22: Operation timed out

My vagrant file looks likem

Vagrant::Config.run do |config|
config.vm.box = “lucid32”
config.vm.forward_port 80, 4567
end

But when I got to localhost:4567 nothing shows (this webpage is not available)

I have a completely fresh install of mountain lion so nothing should be blocking anything.

The vagrant support in Ansible isn’t actually part of Ansible, so I would recommend asking this question in the vagrant forum.

http://www.vagrantup.com/support.html#community

did you check using netstat or nmap that you have the port. you seem to be using the Vagrant version one config file " the older way" Vagrant site have good examples how to provision using Ansible , also try the gran the latest ansible as it has ssh trouble shooting, it will help you big time in diagnosing the connection issue.

you don't yet fully grasp how Vagrant sets up networking and forwarded
ports. Questions about that should be asked in Vagrant's forum
obviously, as Michael pointed out, however what I recommend is to
assign a private network [1] (called a host-only network in the
version 1 config) to your Vagrant machines, and pointing Ansible at
those IPs. The advantage of this is that if you have multiple VM's,
they can easily reach each other as well.

I decided to put my Vagrant-related parts on GitHub [2], so feel free
to use that as a starting point. It contains a few extra goodies such
as adding the Vagrant machines to your local /etc/hosts for you as
well.

[1]: http://docs.vagrantup.com/v2/networking/private_network.html
[2]: https://github.com/zoni/Vagrant-Ansible-example

Derek - here is an example that might help you. It uses vagrant and ansible together. Check out the vagrant config file:

https://github.com/wstrange/frstack