-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include variable 'RandomSleep'. #33
Conversation
When the apt job starts, it will sleep for a random period between 0 and APT::Periodic::RandomSleep seconds. The default value is "1800" so that the script will stall for up to 30 minutes (1800 seconds) so that the mirror servers are not crushed by everyone running their updates all at the same time. Only set this to 0 if you use a local mirror and don't mind the load spikes. Note that while the apt job is sleeping it will cause the execution of the rest of your cron.daily jobs to be delayed.
This supersedes #32 I gather. Thanks. Has the |
@@ -46,3 +46,17 @@ APT::Periodic::Verbose "<%= @verbose %>"; | |||
# 1: progress report (actually any string) | |||
# 2: + command outputs (remove -qq, remove 2>/dev/null, add -d) | |||
# 3: + trace on | |||
<%- unless @random_sleep.nil? -%> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, I keep getting confused by this. Is it Puppet 4 safe? What does undef
end up being in the Ruby world?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested on a puppet4 & puppetserver environment and it works fine.
In this page says the following: "Puppet’s special undef value is roughly equivalent to nil in Ruby; it represents the absence of a value."
https://docs.puppetlabs.com/puppet/latest/reference/lang_data_undef.html
This configuration flag is compatible with debian 6, 7 and 8. Also with ubuntu 10, 12 and 14. |
@@ -93,6 +93,7 @@ Using unattended\_upgrades simply consists of including the module and if needed | |||
* `minimal_steps` (`true`): Split the upgrade process into sections to allow shutdown during upgrade. | |||
* `origins`: The repositories from which to automatically upgrade included packages. | |||
* `package_ensure` (`installed`): The ensure state for the 'unattended-upgrades' package. | |||
* `random_sleep` (`300`): Seconds of delay on the cron job execution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized that this is potentially misleading. The randomness can be gleaned from the option name but the description should be phrased better.
Not a blocker; merging now and we'll fix that in post :-)
Include variable 'RandomSleep'.
When the apt job starts, it will sleep for a random period between 0 and
APT::Periodic::RandomSleep seconds. The default value is "1800" so that
the script will stall for up to 30 minutes (1800 seconds) so that the
mirror servers are not crushed by everyone running their updates all at
the same time. Only set this to 0 if you use a local mirror and don't
mind the load spikes. Note that while the apt job is sleeping it will
cause the execution of the rest of your cron.daily jobs to be delayed.