I need to setup a cookbook to be run daily at 1 am. I am trying to use chef-client cookbook, but no matter what setting I set, it runs about every 30 minutes.
I don;t want to set cron job manually as there are many nodes. I have separate role which is I am using as runlist. I did normal and override attributes from this role to set it up.
I tried to set hour/minute attributes along with use_cron_d to true/false. I tried to use init_style but it still runs every 30 minutes (± splay)
Is there a way to specify timezone in chef-client cron?
I set a cron job to be run at midnight (verified it) and all my servers on UTC, but I see half severs (at least in chef server reports), ran at 5 am and other half at midnight…
Not sure what might cause this.
Was your recipe set to restart crond? And did the timezones on ther server get set to UTC, after crond started, the first time?
I often find it useful to reboot a server when changing the timezone, just to make sure I don’t have to pick and choose which daemons need to be restarted.
knife ssl fetch fails if I use the hostname in the knife.rb file.
I am able to ping telnet to port 443 and wget with the hostname .
[root@chefserver .chef]# knife ssl check
Connecting to host chefserver.lbs.com:443
ERROR: Service temporarily unavailable
/opt/chefdk/embedded/lib/ruby/2.4.0/net/http/response.rb:333:in stream_check': undefined methodclosed?’ for nil:NilClass (NoMethodError)
from /opt/chefdk/embedded/lib/ruby/2.4.0/net/http/response.rb:202:in read_body' from /opt/chefdk/embedded/lib/ruby/2.4.0/net/http/response.rb:229:inbody’
from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/knife.rb:541:in rescue in format_rest_error' from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/knife.rb:538:informat_rest_error’
from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/knife.rb:510:in humanize_http_exception' from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/knife.rb:456:inhumanize_exception’
from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/knife.rb:447:in rescue in run_with_pretty_exceptions' from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/knife.rb:436:inrun_with_pretty_exceptions’
from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/lib/chef/knife.rb:220:in run' from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/ lib/chef/application/knife.rb:160:inrun’
from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.8.5/bin/knife:25:in <top (required)>' from /opt/chefdk/bin/knife:250:inload’
from /opt/chefdk/bin/knife:250:in `’
[root@chefserver .chef]#