Take a look at commit 69837e5 and d632771 and let me know if it looks good.  I haven't removed the Fog call from agent.rb yet as that throws an exception if the api_key and username are not in the node attributes, to I want to understand that code a bit better before I tinker in it.