50unattended-upgrades.erb 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. // Send email to this address for problems or packages upgrades
  32. // If empty or unset then no email is sent, make sure that you
  33. // have a working mail setup on your system. A package that provides
  34. // 'mailx' must be installed.
  35. <% if @mail_to != "NONE" %>Unattended-Upgrade::Mail "<%= @mail_to %>";<% end %>
  36. // Set this value to "true" to get emails only on errors. Default
  37. // is to always send a mail if Unattended-Upgrade::Mail is set
  38. <% if @mail_to != "NONE" %>Unattended-Upgrade::MailOnlyOnError "<%= @mail_only_on_error %>";<% end %>
  39. // Do automatic removal of new unused dependencies after the upgrade
  40. // (equivalent to apt-get autoremove)
  41. Unattended-Upgrade::Remove-Unused-Dependencies "<%= @remove_unused %>";
  42. // Automatically reboot *WITHOUT CONFIRMATION* if a
  43. // the file /var/run/reboot-required is found after the upgrade
  44. Unattended-Upgrade::Automatic-Reboot "<%= @auto_reboot %>";
  45. // Use apt bandwidth limit feature, this example limits the download
  46. // speed to 70kb/sec
  47. <% if @dl_limit != "NONE" %>Acquire::http::Dl-Limit "<%= @dl_limit %>";<% end %>