#
# Cookbook:: irrigate-orchard_base
# Attributes:: unattended_upgrade
#

# Unattended-Upgrade::Origins-Pattern controls which packages are upgraded.
default['unattended_upgrades']['origins_pattern'] = {
  'origin=*,codename=*' => true,
}

# Python regular expressions, matching packages to exclude from upgrading
default['unattended_upgrades']['package_blacklist'] = []

# This option allows you to control if on a unclean dpkg exit unattended-upgrades will automatically run
# dpkg --force-confold --configure -a
default['unattended_upgrades']['auto_fix_interrupted_dpkg'] = true

# Split the upgrade into the smallest possible chunks so that they can be interrupted with SIGTERM.
default['unattended_upgrades']['minimal_steps'] = false

# Install all updates when the machine is shutting down
default['unattended_upgrades']['install_on_shutdown'] = false

# Send email to this address for problems or packages upgrades
default['unattended_upgrades']['mail'] = ''
default['unattended_upgrades']['mail_report'] = 'on-change'

# Remove unused automatically installed kernel-related packages
default['unattended_upgrades']['remove_unused_kernel_packages'] = true

# Do automatic removal of newly unused dependencies after the upgrade
default['unattended_upgrades']['remove_new_unused_dependencies'] = true

# Do automatic removal of unused packages after the upgrade
default['unattended_upgrades']['remove_unused_dependencies'] = false

# Automatically reboot *WITHOUT CONFIRMATION*
default['unattended_upgrades']['automatic_reboot'] = false

# Automatically reboot even if there are users currently logged in
default['unattended_upgrades']['automatic_reboot_with_users'] = true

# If automatic reboot is enabled and needed, reboot at the specific time instead of immediately
default['unattended_upgrades']['automatic_reboot_time'] = '02:00'

# Enable logging to syslog.
default['unattended_upgrades']['syslog_enable'] = false

# Specify syslog facility.
default['unattended_upgrades']['syslog_facility'] = 'daemon'

# Download and install upgrades only on AC power
default['unattended_upgrades']['only_on_ac_power'] = true

# Verbose logging
default['unattended_upgrades']['verbose'] = false

# Print debugging information
default['unattended_upgrades']['debug'] = false

# Allow package downgrade if Pin-Priority exceeds 1000
default['unattended_upgrades']['allow_downgrade'] = false

# Enable fallback for APT fails to mark a package to be upgraded
default['unattended_upgrades']['allow_apt_mark_fallback'] = true

# intervals in days
default['unattended_upgrades']['update_package_lists'] = 1
default['unattended_upgrades']['unattended_upgrade'] = 1

# Systemd timer schedule — constrained to 02:00-05:00 UTC to avoid
# dpkg lock conflicts with chef-client / kitchen during EU and US working hours.
default['unattended_upgrades']['apt_daily_oncalendar'] = '*-*-* 02:00'
default['unattended_upgrades']['apt_daily_randomized_delay'] = '30m'
default['unattended_upgrades']['apt_upgrade_oncalendar'] = '*-*-* 03:00'
default['unattended_upgrades']['apt_upgrade_randomized_delay'] = '60m'
default['unattended_upgrades']['apt_upgrade_on_boot_delay'] = '30min'
