Skip to content

Commit e0b73ce

Browse files
Merge pull request #111 from Normo/reformat-config-template
fix: reformat config template
2 parents 9139267 + 8b900c1 commit e0b73ce

File tree

1 file changed

+30
-29
lines changed

1 file changed

+30
-29
lines changed

templates/unattended-upgrades.j2

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,28 @@
88
// Overrides for `20auto-upgrades`. //////////////////////////////////////////
99

1010
APT::Periodic::Unattended-Upgrade "1";
11-
1211
{% if unattended_update_package_list is defined %}
12+
1313
APT::Periodic::Update-Package-Lists "{{unattended_update_package_list}}";
1414
{% endif %}
15-
1615
{% if unattended_download_upgradeable is defined %}
16+
1717
APT::Periodic::Download-Upgradeable-Packages "{{unattended_download_upgradeable}}";
1818
{% endif %}
19-
2019
{% if unattended_autoclean_interval is defined %}
20+
2121
APT::Periodic::AutocleanInterval "{{unattended_autoclean_interval}}";
2222
{% endif %}
23-
2423
{% if unattended_clean_interval is defined %}
24+
2525
APT::Periodic::CleanInterval "{{unattended_clean_interval}}";
2626
{% endif %}
27-
2827
{% if unattended_verbose is defined %}
28+
2929
APT::Periodic::Verbose "{{unattended_verbose}}";
3030
{% endif %}
31-
3231
{% if unattended_random_sleep is defined %}
32+
3333
APT::Periodic::RandomSleep "{{unattended_random_sleep}}";
3434
{% endif %}
3535

@@ -40,24 +40,25 @@ APT::Periodic::RandomSleep "{{unattended_random_sleep}}";
4040
// upgraded.
4141
Unattended-Upgrade::Origins-Pattern {
4242
{% if unattended_origins_patterns is defined %}
43-
{% for origin in unattended_origins_patterns %}
44-
"{{ origin }}";
45-
{% endfor %}
43+
{%- for origin in unattended_origins_patterns %}
44+
"{{ origin }}";
45+
{%- endfor %}
4646
{% else %}
47-
{% for origin in __unattended_origins_patterns %}
48-
"{{ origin }}";
49-
{% endfor %}
47+
{%- for origin in __unattended_origins_patterns %}
48+
"{{ origin }}";
49+
{%- endfor %}
5050
{% endif %}
51+
5152
};
5253

5354
// List of packages to not update (regexp are supported)
5455
Unattended-Upgrade::Package-Blacklist {
5556
{% for package in unattended_package_blacklist %}
56-
"{{package}}";
57+
"{{package}}";
5758
{% endfor %}
5859
};
59-
6060
{% if not unattended_autofix_interrupted_dpkg %}
61+
6162
// This option allows you to control if on a unclean dpkg exit
6263
// unattended-upgrades will automatically run
6364
// dpkg --force-confold --configure -a
@@ -70,86 +71,86 @@ Unattended-Upgrade::AutoFixInterruptedDpkg "false";
7071
// a bit slower but it has the benefit that shutdown while a upgrade
7172
// is running is possible (with a small delay)
7273
Unattended-Upgrade::MinimalSteps "{{ unattended_minimal_steps | lower }}";
73-
7474
{% if unattended_install_on_shutdown %}
75+
7576
// Install all unattended-upgrades when the machine is shuting down
7677
// instead of doing it in the background while the machine is running
7778
// This will (obviously) make shutdown slower
7879
Unattended-Upgrade::InstallOnShutdown "true";
7980
{% endif %}
80-
8181
{% if unattended_mail %}
82+
8283
// Send email to this address for problems or packages upgrades
8384
// If empty or unset then no email is sent, make sure that you
8485
// have a working mail setup on your system. A package that provides
8586
// 'mailx' must be installed.
8687
Unattended-Upgrade::Mail "{{unattended_mail}}";
8788
{% endif %}
88-
8989
{% if unattended_mail_sender %}
90+
9091
Unattended-Upgrade::Sender "{{unattended_mail_sender}}";
9192
{% endif %}
92-
9393
{% if unattended_mail_only_on_error %}
94+
9495
// Set this value to "true" to get emails only on errors. Default
9596
// is to always send a mail if Unattended-Upgrade::Mail is set
9697
Unattended-Upgrade::MailOnlyOnError "true";
9798
{% endif %}
98-
9999
{% if unattended_mail_report %}
100+
100101
// Set this value to one of:
101102
// "always", "only-on-error" or "on-change"
102103
// If this is not set, then any legacy MailOnlyOnError (boolean) value
103104
// is used to chose between "only-on-error" and "on-change"
104105
Unattended-Upgrade::MailReport "{{ unattended_mail_report }}";
105106
{% endif %}
106-
107107
{% if unattended_remove_unused_dependencies %}
108+
108109
// Do automatic removal of all unused dependencies after the upgrade
109110
// (equivalent to apt-get autoremove)
110111
Unattended-Upgrade::Remove-Unused-Dependencies "true";
111112
{% endif %}
112-
113113
{% if not unattended_remove_new_unused_dependencies %}
114+
114115
// Do automatic removal of new unused dependencies after the upgrade
115116
Unattended-Upgrade::Remove-New-Unused-Dependencies "false";
116117
{% endif %}
117-
118118
{% if unattended_remove_unused_kernel_packages %}
119+
119120
// Remove unused automatically installed kernel-related packages
120121
// (kernel images, kernel headers and kernel version locked tools).
121122
Unattended-Upgrade::Remove-Unused-Kernel-Packages "true";
122123
{% endif %}
123-
124124
{% if unattended_automatic_reboot %}
125+
125126
// Automatically reboot *WITHOUT CONFIRMATION* if a
126127
// the file /var/run/reboot-required is found after the upgrade
127128
Unattended-Upgrade::Automatic-Reboot "true";
128129
{% endif %}
129-
130130
{% if unattended_automatic_reboot_time %}
131+
131132
// If automatic reboot is enabled and needed, reboot at the specific
132133
// time instead of immediately
133134
// Default: "now"
134135
Unattended-Upgrade::Automatic-Reboot-Time "{{ unattended_automatic_reboot_time }}";
135136
{% endif %}
136-
137137
{% if unattended_update_days is defined %}
138+
138139
// Set the days of the week that updates should be applied. The days can be specified
139140
// as localized abbreviated or full names. Or as integers where "0" is Sunday, "1" is
140141
// Monday etc.
141142
// Example - apply updates only on Monday and Friday:
142143
// {"Mon";"Fri"};
143144
Unattended-Upgrade::Update-Days {{ unattended_update_days }};
144145
{% endif %}
145-
146146
{% if unattended_ignore_apps_require_restart %}
147+
147148
// Do upgrade application even if it requires restart after upgrade
148149
// I.e. "XB-Upgrade-Requires: app-restart" is set in the debian/control file
149150
Unattended-Upgrade::IgnoreAppsRequireRestart "true";
150151
{% endif %}
151-
152152
{% if unattended_syslog_enable %}
153+
153154
// Write events to syslog, which is useful in environments where syslog
154155
// messages are sent to a central store.
155156
Unattended-Upgrade::SyslogEnable "{{ unattended_syslog_enable }}";
@@ -160,17 +161,17 @@ Unattended-Upgrade::SyslogEnable "{{ unattended_syslog_enable }}";
160161
Unattended-Upgrade::SyslogFacility "{{ unattended_syslog_facility }}";
161162
{% endif %}
162163
{% endif %}
163-
164164
{% if unattended_dpkg_options %}
165+
165166
// Append options for governing dpkg behavior, e.g. --force-confdef.
166167
Dpkg::Options {
167168
{% for dpkg_option in unattended_dpkg_options %}
168169
"{{ dpkg_option }}";
169170
{% endfor %}
170171
};
171172
{% endif %}
172-
173173
{% if unattended_dl_limit is defined %}
174+
174175
// Use apt bandwidth limit feature, this example limits the download
175176
// speed to 70kb/sec
176177
Acquire::http::Dl-Limit "{{ unattended_dl_limit }}";

0 commit comments

Comments
 (0)