50unattended-upgrades.erb 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // Automatically upgrade packages from these (origin:archive) pairs
  2. <%- if @legacy_origin -%>
  3. Unattended-Upgrade::Allowed-Origins {
  4. <%- else -%>
  5. Unattended-Upgrade::Origins-Pattern {
  6. <%- end -%>
  7. <% @origins.each do |origin| -%>
  8. "<%= origin %>";
  9. <% end -%>
  10. };
  11. // List of packages to not update
  12. Unattended-Upgrade::Package-Blacklist {
  13. <% @blacklist.each do |package| -%>
  14. "<%= package %>";
  15. <% end -%>
  16. };
  17. // This option allows you to control if on a unclean dpkg exit
  18. // unattended-upgrades will automatically run
  19. // dpkg --force-confold --configure -a
  20. // The default is true, to ensure updates keep getting installed
  21. Unattended-Upgrade::AutoFixInterruptedDpkg "<%= @auto_fix %>";
  22. // Split the upgrade into the smallest possible chunks so that
  23. // they can be interrupted with SIGUSR1. This makes the upgrade
  24. // a bit slower but it has the benefit that shutdown while a upgrade
  25. // is running is possible (with a small delay)
  26. Unattended-Upgrade::MinimalSteps "<%= @minimal_steps %>";
  27. // Install all unattended-upgrades when the machine is shuting down
  28. // instead of doing it in the background while the machine is running
  29. // This will (obviously) make shutdown slower
  30. Unattended-Upgrade::InstallOnShutdown "<%= @install_on_shutdown %>";
  31. <% if @mail_to != "NONE" %>
  32. // Send email to this address for problems or packages upgrades
  33. // If empty or unset then no email is sent, make sure that you
  34. // have a working mail setup on your system. A package that provides
  35. // 'mailx' must be installed.
  36. Unattended-Upgrade::Mail "<%= @mail_to %>";
  37. <% end %>
  38. <% if @mail_to != "NONE" %>
  39. // Set this value to "true" to get emails only on errors. Default
  40. // is to always send a mail if Unattended-Upgrade::Mail is set
  41. Unattended-Upgrade::MailOnlyOnError "<%= @mail_only_on_error %>";
  42. <% end %>
  43. // Do automatic removal of new unused dependencies after the upgrade
  44. // (equivalent to apt-get autoremove)
  45. Unattended-Upgrade::Remove-Unused-Dependencies "<%= @remove_unused %>";
  46. // Automatically reboot *WITHOUT CONFIRMATION* if a
  47. // the file /var/run/reboot-required is found after the upgrade
  48. Unattended-Upgrade::Automatic-Reboot "<%= @auto_reboot %>";
  49. <% if @dl_limit != "NONE" %>
  50. // Use apt bandwidth limit feature, this example limits the download
  51. // speed to 70kb/sec
  52. Acquire::http::Dl-Limit "<%= @dl_limit %>";
  53. <% end %>