I found a situation when chef had generated Chef::Exceptions::CommandTimeout exception in git clone command. Sometimes the time of git clone could be more than 10 minutes. How to set the timeout value for such situations in chef recipe?
Timeout for the git provider seems to be fixed now.
Checkout the code at: https://github.com/opscode/chef/blob/master/lib/chef/provider/git.rb#L292
So for the git resource you can just add the timeout
attribute, i.e.:
git /var/www do
repository <githubrepo>
action :sync
user www-data
group www-data
timeout 1200
end
There is no simple way of changing timeout, I mean by passing some attributes. You will have to overwrite run_options method in git provider. Check out When monkey patching a method, can you call the overridden method from the new implementation? for different possibilities.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With