[chef] Re: Automatic Config Templator


Chronological Thread 
  • From: Guilhem Lettron < >
  • To:
  • Subject: [chef] Re: Automatic Config Templator
  • Date: Tue, 8 Apr 2014 11:56:58 +0200

Hi,

I try to create something like this with my cookbook "conffile": http://community.opscode.com/cookbooks/conffile

The goal is to create a configuration file from an Hash.

My documentation is quite... poor.. because I changed my mind so many many time...

For the moment I can only manipulating "INI" type file for the moment (like you seems to want).


Even if "ini" type file are really old... manipulating this with ruby is really a mess!
Many different lib, none of them perfect.

I will be really happy if you are helping me to improve this. :)

Guilhem Lettron


On Tue, Apr 8, 2014 at 12:59 AM, < " target="_blank"> > wrote:
This seems like a common problem that I'm pretty sure someone would have solved
already.

Usually a service has a random config file which has something like:
somevar somevalue
or
somevar=somevalue

and i'd be nice to automatically go from that to this:

attributes/default.rb:
default['someservice'][‘someconfig’][‘somevar’]=”somevalue”

template/default/someconfig.erb
somevar=<%= @node['someservice'][‘someconfig’][‘somevar’] %>

Then you just need to define various patterns to identify configs like:
A:B
A=B
A B

And could even do something like
#automatic commentary
A=B

Anyone know if this already exists?




Archive powered by MHonArc 2.6.16.

§