# Generate a uniformly distributed unique number to sleep. if node['chef_client']['splay'].to_i > 0 checksum = Digest::MD5.hexdigest(node['fqdn'] || 'unknown-hostname') sleep_time = checksum.to_s.hex % node['chef_client']['splay'].to_i else sleep_time = nil end
This is random enough so you won't kill the server, and deterministic so the resource isn't always changing every Chef run.
This is random enough so you won't kill the server, and deterministic so the resource isn't always changing every Chef run.