[chef] Reading Node attributes from Serverspec


Chronological Thread 
  • From: Marcus Simonsen < >
  • To: " " < >
  • Subject: [chef] Reading Node attributes from Serverspec
  • Date: Thu, 11 Jun 2015 15:44:31 +0000
  • Accept-language: en-GB, en-CA, en-US

So I've read a couple articles on reading in node attributes like:
http://jakshi.com/blog/2014/05/12/accessing-chef-attributes-in-serverspec-tests/
This is done from within the context of kitchen.  Is there a way that I could read in this node information from a remote ServerSpec test?

What I'd like to accomplish is perform tests on the node without it being managed by kitchen (it's been brought up by another VM management system for example) and it doesn't have the privilege or the knowledge of useful recipes that build out the node information in a json file somewhere.

My thought was to produce an application like chef-solo, that could be run remotely - that collects the data and loads it into the current running spec.  The other thought was that why don't I query chef-server to get those node attributes (through REST interface). 
The second option seems just much easier and cleaner - but requires presence and registration to a chef-server - not ideal during cookbook development lifecycle.

The other thing I'd like to accomplish is that my kitchen tests are the same whether they are performed from within kitchen or from a remote context.



  • [chef] Reading Node attributes from Serverspec, Marcus Simonsen, 06/11/2015

Archive powered by MHonArc 2.6.16.

§