Add configuration options to unattended_upgrades
This commit is contained in:
parent
b22e1ba3d0
commit
483780a828
3
system/base/unattended_upgrades/defaults/main.yml
Normal file
3
system/base/unattended_upgrades/defaults/main.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
system_base_unattended_upgrades_n_days: 1
|
||||||
|
system_base_unattended_upgrades_blacklist: []
|
@ -1,2 +0,0 @@
|
|||||||
APT::Periodic::Update-Package-Lists "1";
|
|
||||||
APT::Periodic::Unattended-Upgrade "1";
|
|
11
system/base/unattended_upgrades/meta/argument_specs.yml
Normal file
11
system/base/unattended_upgrades/meta/argument_specs.yml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
argument_specs:
|
||||||
|
main:
|
||||||
|
options:
|
||||||
|
system_base_unattended_upgrades_n_days:
|
||||||
|
type: "int"
|
||||||
|
required: true
|
||||||
|
system_base_unattended_upgrades_blacklist:
|
||||||
|
type: "list"
|
||||||
|
elements: "str"
|
||||||
|
required: true
|
@ -4,13 +4,13 @@
|
|||||||
name: "unattended-upgrades"
|
name: "unattended-upgrades"
|
||||||
|
|
||||||
- name: "configure unattended-upgrades"
|
- name: "configure unattended-upgrades"
|
||||||
ansible.builtin.copy:
|
ansible.builtin.template:
|
||||||
src: "./50unattended-upgrades"
|
src: "./50unattended-upgrades.j2"
|
||||||
dest: "/etc/apt/apt.conf.d/50unattended-upgrades"
|
dest: "/etc/apt/apt.conf.d/50unattended-upgrades"
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
|
||||||
- name: "enable unattended-upgrades"
|
- name: "enable unattended-upgrades"
|
||||||
ansible.builtin.copy:
|
ansible.builtin.template:
|
||||||
src: "./20auto-upgrades"
|
src: "./20auto-upgrades.j2"
|
||||||
dest: "/etc/apt/apt.conf.d/20auto-upgrades"
|
dest: "/etc/apt/apt.conf.d/20auto-upgrades"
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
APT::Periodic::Update-Package-Lists "{{ system_base_unattended_upgrades_n_days }}";
|
||||||
|
APT::Periodic::Unattended-Upgrade "{{ system_base_unattended_upgrades_n_days }}";
|
@ -44,6 +44,9 @@ Unattended-Upgrade::Origins-Pattern {
|
|||||||
|
|
||||||
// Python regular expressions, matching packages to exclude from upgrading
|
// Python regular expressions, matching packages to exclude from upgrading
|
||||||
Unattended-Upgrade::Package-Blacklist {
|
Unattended-Upgrade::Package-Blacklist {
|
||||||
|
{% for package_regex in system_base_unattended_upgrades_blacklist %}
|
||||||
|
"{{ package_regex }}";
|
||||||
|
{% endfor %}
|
||||||
// The following matches all packages starting with linux-
|
// The following matches all packages starting with linux-
|
||||||
// "linux-";
|
// "linux-";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user