- From: Juan Jesús Ojeda Croissier <
>
- To:
- Subject: [chef] Re: Re: Re: Re: Re: how to translate file from nodes to Chef server?
- Date: Tue, 14 Feb 2012 06:42:31 +0000
Hi tetsu,
Here some info about how to write Ohai Plugins:
http://wiki.opscode.com/display/chef/Writing+Ohai+Plugins
And how to distribute them to your nodes:
http://wiki.opscode.com/display/chef/Distributing+Ohai+Plugins
It's quite handy to use them to save data from your nodes and get
later some metrics or to be used by recipes.
I hope this helps.
Cheers :-)
On Tue, Feb 14, 2012 at 1:53 AM, oscar schneider
<
>
wrote:
>
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
>
>
>
> On 2012/02/14, at 2:17, oscar schneider
>
> <
>
>
> wrote:
>
>
>
> 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
>
> <
>
>
> 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
>
>> <
>
>
>> SAGE Level IV, Chef Level 0.0.1
>
>>
>
>
>
--
Juanje
Archive powered by MHonArc 2.6.16.