Monthly Archives: September 2011

Opscode Chef notes

Mostly for my benefit.

I was getting this error on a server:

FATAL: NoMethodError: private method `gsub' called for nil:NilClass

Turned out I didn’t have my hostname set.

# hostname -f
hostname: Unknown host

After setting my hostname the error went away.


I wanted to set some attributes in a role that could be used by a bunch of recipes.

This is the syntax I used.

:ganglia_server => "",
:serveradmin => ""

Then in a template I used.


 owner = "<%= node.serveradmin %>"
 host = "<%= node.ganglia_server %>"

Maybe is should have been obvious to do it this way. But for me it wasn’t.



Filed under Uncategorized