Support to specify timeout.
Hi
I have a target host that for some reason installs gitlab slowly, taking a little more time than the 900 seconds default, so the package resource times out and the install fails.
So I tried to fix it by cloning the cookbook-omnibus-gitlab locally and made the following changes:
To attributes/default.rb I added one line:
default['omnibus-gitlab']['package']['version'] = nil
default['omnibus-gitlab']['package']['timeout'] = nil ## added line
default['omnibus-gitlab']['data_bag'] = nil
and to recipes/default.rb I added three lines:
package node['omnibus-gitlab']['package']['name'] do
version node['omnibus-gitlab']['package']['version']
options '--force-yes'
if node['omnibus-gitlab']['package']['timeout'] ## added line
timeout "#{node['omnibus-gitlab']['package']['timeout']}".to_i ## added line
end ## added line
notifies :run, 'execute[gitlab-ctl reconfigure]'
end
As the target runs Ubuntu, I did not bother with adding similar lines for other OS kinds.
I am not a Chef expert so maybe there are other and better ways to be able to override the default timeout. Anyway, the fix solves my issue.
Jan