0

I have the following piece of code to download an installer

remote_file '/tmp/apache-tomcat-8.0.23.tar.gz' do
  source 'http://mirror.sdunix.com/apache/tomcat/tomcat-8/v8.0.23/bin/apache-tomcat-8.0.23.tar.gz'
end

which when executed using kitchen converge gives

     =====================================================================   ===========
           Error executing action `create` on resource 'remote_file[/tmp/apache-
tomcat-8.0.23.tar.gz]'
           =====================================================================
===========

           Errno::ENETUNREACH
           ------------------
           Failed to open TCP connection to mirror.sdunix.com:80 (Network is unr
eachable - connect(2) for "mirror.sdunix.com" port 80)

Any idea why am I getting this network issue?

StephenKing
  • 36,187
  • 11
  • 83
  • 112
codec
  • 7,978
  • 26
  • 71
  • 127
  • Which VM provider do you use beneath test-kitchen? – Draco Ater Apr 25 '17 at 09:33
  • I use Vagrant VIrtualbox – codec Apr 25 '17 at 09:34
  • Can you access internet from your VM? How is your network configured? – Draco Ater Apr 25 '17 at 09:34
  • driver: name: vagrant network: - ["private_network", {ip: "192.168.35.35"}] – codec Apr 25 '17 at 09:35
  • 1
    You use "private network". Here is a quote from vagrant docs: "These IPs are guaranteed to never be publicly routable, and most routers actually block traffic from going to them from the outside world." https://www.vagrantup.com/docs/networking/private_network.html You have to use "public network" or "forwarded ports". – Draco Ater Apr 25 '17 at 09:39

1 Answers1

0

I guess that the url you are using as source for the remote file is not publicly reachable (I can't resolve it), so my bet is that you are missing a proper network configuration in your kitchen-vagrant virtual machine. Are you using correct dns servers? If you don't need/have them, try updating your /etc/hosts file so it contains the address os http://mirror.sdunix.com/.

Navarro
  • 1,284
  • 2
  • 17
  • 40