chef-provisioning
chef-provisioning copied to clipboard
client.rb configuration file content of new clients should have a more flexible configuration
Hi,
I'm finding I need to launch new nodes with the option no_lazy_load true
in their chef-client configuration /etc/chef/client.rb
but I don't find a good to achieve this.
I took at look at the source code and I found this: https://github.com/opscode/chef-provisioning/blob/8c82d69967fd0992870a956694a99eb569aa94fc/lib/chef/provisioning/convergence_strategy/precreate_chef_objects.rb#L184.
It looks like right now I can't configure this, right?
@nomadium give chef-client
cookbook a try: https://github.com/opscode-cookbooks/chef-client
If you need to get this option set during bootstrap, consider custom bootstrap template: https://github.com/opscode/chef/blob/master/lib/chef/knife/bootstrap/chef-full.erb
Alternatively, you can set higher TTL on the server side with erchef['s3_url_ttl'] = 1800
(it's in seconds) in /etc/chef/chef-server.rb
(you need to reconfigure
afterwards). For more details: https://docs.getchef.com/config_rb_chef_server.html
@kwilczynski but on the first chef-client run just after a node had been created with chef-provisioning (or chef-metal) I don't think I couldn't manage /etc/chef/client.rb
with that cookbook yet, right? I could use it to setup my chef settings for subsequents chef-client run but not on the first one I believe.
I'm looking for a way to set arbitrary chef-client settings from chef-provisioning or at least to be able to setup the option no_lazy_load => true
.
I read this setting is going to be the default for Chef 12 but in the meantime is annoying to don't have a way to set it at that early stage.
@nomadium sadly, you are right. I thought it would play nice with client-side. What about bumping on the Chef Server side? Unless you are Hosted Chef user.
@kwilczynski I'll test this with Chef Server. However, I'm using chef-provisioning mostly with Hosted Chef.
I could being able to inject client.rb options would be a useful feature -- I'll mark it as post 1.0 for the meantime since it's not a show-stopping issue. Also, no_lazy_load
should default to true, shouldn't it?
I agree, it's not a show stopper and it will be mitigated when Chef 12 switches no_lazy_load
to true but of course it would be great to have total control of chef client settings for the new machines.
It should be pretty easy to fix, too ... just add an option to convergence options.
I believe this is done. I'm happily creating machines with additional config using chef_config: chef_config
in my convergence options. Definitely needs to be added to the official docs though.
Great, I'll give a try.