Question

I using Test-Kitchen and Vagrant to do integration test on my cookbooks. But when I use kitchen login and enter into my VM to proof manually the status of apache2 service (I'm on ubuntu 12.04) there is not problems, it service is running but when I try to access from my host in this way

http://localhost:8080

and it not respond.

And it is my .kitchen.yml

---
driver:
  name: vagrant

provisioner:
  name: chef_solo

platforms:
  - name: ubuntu-12.04
    driver_config:
      box: "ubuntu-12.04"

suites:
  - name: default
    run_list:
    - recipe[web::default]
    attributes:

My doubt is about if is necessary to configure something else on kitchen.yml, maybe something relative to netwotk..

Was it helpful?

Solution

You need to configure the port forwarding, or (IMHO a better option) a separate network interface with known IP address which you can use to connect to directly from the host.

For example:

driver:
  network:
  - ["private_network", { ip: "192.168.33.101" }]

See the kitchen-vagrant and Vagrant docs for more information.

Also make sure that apache binds to that (or all) interfaces. The same with port forwarding, as it will point to the default NAT interface, not to the loopback.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top