[chef] Re: Re: Re: Re: how to translate file from nodes to Chef server?


Chronological Thread 
  • From: oscar schneider < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: how to translate file from nodes to Chef server?
  • Date: Tue, 14 Feb 2012 02:53:22 +0100

Hey,

yes, doing this via an ohai plugin would probably be easiest, however you are free to also set it from within a recipe.

Imagine you designate the node[:conffiles] attribute space, then in your recipe you'd do something like 

sshd_conf = File.read("/etc/ssh/sshd_config")
# If you only wanna set the attribute the very first time, not on each run:
node.set_unless[:conffiles][:sshd_config] = sshd_conf
# or simply
node[:conffiles][:ssh_config] = File.read("/etc/ssh/ssh_config")

Regarding the (in)feasability to install/configure vcs on each node, maybe a standard webdav server (e.g. apache with mod_dav) would do the job?

Cheers,

Oscar

On Mon, Feb 13, 2012 at 10:41 PM, < "> > wrote:
Hi,

Thank you for your solution.

For committing to central version control system, git or svn client is required for each node. It may be hard in my case. Another problem is the burden to the vcs. Number of nodes is huge.

I'm interesting on the approach to save conf as key/value. Could you detail this? how can I save attribute from nodes to Chef server? Using Ohai extension?

Thank you!

Tetsu
Hi,

you could also save the content of the config file as an attribute value, then store the content to a file on the chef server and set the attributes to nil afterwards.
However committing them to a git or svn server seems to be better suited for the job. For commit rights to a svn server you could use the existing Chef client certificates if you dislike anonymous commits. Not sure if git also provides a ssl certificate based frontend.

Cheers,

Oscar 

On Mon, Feb 13, 2012 at 4:54 PM, Brad Knowles < " target="_blank"> > wrote:
On Feb 13, 2012, at 8:29 AM, tetsu soh wrote:

> Is there anyway to get files from each nodes to Chef server?
> I need to collect conf files from nodes and then manage them.

Have each node commit updates to their files to a central code repository server, like git & maybe github or your own private git server?

--
Brad Knowles < " target="_blank"> >
SAGE Level IV, Chef Level 0.0.1






Archive powered by MHonArc 2.6.16.

§