Hi,
I would like to set the options in the /etc/chef/client.rb file at a knife bootstrap so that first client run are loggt too.
The options I want to set are:
log_level :info
log_location "/var/log/chef-client_run.log"
verbose_logging true
Is this possible?
Thanks
Oleg
On Wed, Nov 28, 2012 at 1:06 PM, Oleg Volotov oleg.volotov@gmx.de wrote:
Hi,
I would like to set the options in the /etc/chef/client.rb file at a knife
bootstrap so that first client run are loggt too.
I think your best bet is to add the chef-client cookbook to the run list
and let it update the client.rb.
On Wednesday, November 28, 2012 at 4:57 AM, Andrea Campi wrote:
On Wed, Nov 28, 2012 at 1:06 PM, Oleg Volotov <oleg.volotov@gmx.de (mailto:oleg.volotov@gmx.de)> wrote:
Hi,
I would like to set the options in the /etc/chef/client.rb file at a knife bootstrap so that first client run are loggt too.
I think your best bet is to add the chef-client cookbook to the run list and let it update the client.rb.
If you want to get these options picked up by the bootstrap run, you'll need to customize the bootstrap template (which generates the script that knife bootstrap
runs on the remote system). Currently, there are no options for log location in the bootstrap code, so you'd want to replace the call to the config_content method in the template with your desired config, or replace the start_chef
method with something that runs chef-client -L /path/to/log
.
The links below should get you started.
http://wiki.opscode.com/display/chef/Custom+Knife+Bootstrap+Script
https://github.com/opscode/chef/blob/master/lib/chef/knife/bootstrap/chef-full.erb
https://github.com/opscode/chef/blob/master/lib/chef/knife/core/bootstrap_context.rb
--
Daniel DeLeo