[chef] Re: Re: read-only access to data in the chef-repository


Chronological Thread 
  • From: Bryan Berry < >
  • To:
  • Subject: [chef] Re: Re: read-only access to data in the chef-repository
  • Date: Fri, 4 Nov 2011 16:54:59 +0100

hmm, i could but then I would have to reverse-engineer coderanger's pychef
https://github.com/coderanger/pychef/blob/master/chef/api.py in order to handle the authentication properly

could be a little challenging

On Fri, Nov 4, 2011 at 4:40 PM, Bryan Baugher < "> > wrote:
You could try using their server-api[1] to access client or data bag information.

[1] - http://wiki.opscode.com/display/chef/Server+API


On Fri, Nov 4, 2011 at 10:22 AM, Bryan Berry < " target="_blank"> > wrote:
Dear Chefs,

I have a question about how to programmatically get read access to the data in the chef-repository

We are a java-heavy shop, which mean than configuration gets baked into software in two places, on our jenkins CI server during the .war build process and on the target node as well.

I intend to store all the application configuration details in Chef databags, details like:

target database server:
database auth credentials
clustering info
http port
https port
other ports

I intend to create maven target that grabs such information from the chef server

I found that I can get read-only access from any server that is a chef-client

$ knife search jboss_apps "type:production" -c /etc/chef/client.rb -F json

I had to add one value to client.rb    to get the above to work

node_name   'foo.example.com'

I would love to know how to do this with pure ruby. Any ideas?

I need to query the chef-server, grab a bunch of values, then throw them into jboss-foo.xml.erb template and compile that template. If you fellow Chefs see any issues w/ this approach, pls let me know :)





Archive powered by MHonArc 2.6.16.

§