Chef Error: Knife configure

When doing your initial “knife configure -i” command while setting up a chef workstation, if you encounter this error:

ERROR: Errno::EHOSTUNREACH: No route to host - connect(2)

Make sure you check your firewall settings.

On CentOS you can do:

sudo iptables -S

This will show you what is enabled currently. If you don not have port 443 open you will run into issues. To open it you can do this:

-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT

Make sure you save your changes…

sudo service iptables save

…and restart the firewall…

sudo service iptables restart

Fresh start – Installing Centos 6.4

Today I decided to start fresh with my lab and re-install and setup everything as before but documenting it all along the way.

So far today I have installed Centos 6.4 386. The box I have to currently work with is just a old Gateway that only has a 40Gb drive with 1Gb of ram in it. Its the first gen 1Ghz processor from AMD.

I chose the min install so that I could have the smallest footprint I could manage and then configure everything by hand. First thing I did was get networking setup. I went into the /etc/sysconfig/network-scripts file/ifcfg-eth0 and entered my info. Here is what I added…

ONBOOT=yes <- NOTE this line and set to On if you want the NIC to turn on at bootup

I then altered the /etc/hosts file to look like this: localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

And then I altered the /etc/resolve.conf file to look like this:

domain home
search homenameserver

Ran /etc/init.d/network restart and just like that I was able to connect to the outside world. The first thing I did was run a YUM UPDATE and then a yum groupinstall “Networking Tools”

There was a little gotcha that I ran across. Centos6.4 minimum install doesnt automatically install Network Manager or system-config-network or system-config-network-tui so thats why I had to manually configure all of this by hand.

That was all for today. Next i will be installing Puppet and get started working on setting up resources with that.