Skip to content
This repository has been archived by the owner on Jun 25, 2023. It is now read-only.

Commit

Permalink
Add Syslog-related options (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
dnmvisser authored Feb 8, 2021
1 parent 9960a79 commit 39174e2
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ On some hosts you may find that the unattended-upgrade's cronfile `/etc/cron.dai
* Default: disabled
* `unattended_ignore_apps_require_restart`: unattended-upgrades won't automatically upgrade some critical packages requiring restart after an upgrade (i.e. there is `XB-Upgrade-Requires: app-restart` directive in their debian/control file). With this option set to `true`, unattended-upgrades will upgrade these packages regardless of the directive.
* Default: `false`
* `unattended_syslog_enable`: Write events to syslog, which is useful in environments where syslog messages are sent to a central store.
* Default: `false`
* `unattended_syslog_facility`: Write events to the specified syslog facility, or the daemon facility if not specified. Will only have affect if `unattended_syslog_enable` is set to `true`.
* Default: `daemon`
* `unattended_verbose`: Define verbosity level of APT for periodic runs. The output will be sent to root.
* Possible options:
* `0`: no report
Expand Down
11 changes: 11 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ unattended_automatic_reboot_time: false
# I.e. "XB-Upgrade-Requires: app-restart" is set in the debian/control file
unattended_ignore_apps_require_restart: false

#Unattended-Upgrade::SyslogEnable
# Write events to syslog, which is useful in environments where syslog
# messages are sent to a central store.
unattended_syslog_enable: false

#Unattended-Upgrade::SyslogFacility
# Write events to the specified syslog facility, or the daemon facility if
# not specified. Requires the Unattended-Upgrade::SyslogEnable option to be
# set to true.
#unattended_syslog_facility: "daemon"

### APT::Periodic configuration
# Snatched from /usr/lib/apt/apt.systemd.daily

Expand Down
12 changes: 12 additions & 0 deletions templates/unattended-upgrades.j2
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,18 @@ Unattended-Upgrade::Update-Days {{ unattended_update_days }};
Unattended-Upgrade::IgnoreAppsRequireRestart "true";
{% endif %}

{% if unattended_syslog_enable %}
// Write events to syslog, which is useful in environments where syslog
// messages are sent to a central store.
Unattended-Upgrade::SyslogEnable "{{ unattended_syslog_enable }}";
{% if unattended_syslog_facility is defined %}
// Write events to the specified syslog facility, or the daemon facility
// if not specified. Requires the Unattended-Upgrade::SyslogEnable option
// to be set to true.
Unattended-Upgrade::SyslogFacility "{{ unattended_syslog_facility }}";
{% endif %}
{% endif %}

{% if unattended_dpkg_options %}
// Append options for governing dpkg behavior, e.g. --force-confdef.
Dpkg::Options {
Expand Down

0 comments on commit 39174e2

Please sign in to comment.