I've created a simple cookbook to run the chef-client on Windows and Linux every 30 minutes. This worked without issue on Windows 10 Home, but on a Windows 10 Pro box, it's set as a one-time task and doesn't work.
This is the code:
windows_task 'chef-client' do
user 'WIN10\myuser'
password 'supersecretpassword
command 'chef-client'
run_level :highest
frequency :minute
frequency_modifier 30
end
Perhaps a bug?
I should add that in looking at the actual task on the Windows box, the "run once" box was ticked, rather than "run daily" (based on the code above). The :minute and 30 were added correctly, but the task was not set to daily.
Try setting the frequency
to :daily
as you want the task to "run daily".
windows_task 'chef-client' do
command 'chef-client'
frequency :daily
frequency_modifier 30
end
Thanks @seshardi_c. Wouldn't the 30 modifier = 30 days, or am I overthinking it? I'm looking for daily + every 30 minutes.
You are right, using :minute
with frequency_modifier 30
does create a task that runs every 30 minutes on my machine. Perhaps its a difference of chef-client version. I'm running 16.1.