From cfc780d90fa0c6072e296e40cae22b44dc978528 Mon Sep 17 00:00:00 2001 From: shirenn Date: Thu, 22 Dec 2022 10:57:36 +0100 Subject: [PATCH] [unattended] fixup --- host_vars/ptf.adm.crans.org.yml | 6 ------ plays/utilities.yml | 4 ++++ .../templates/apt/apt.conf.d/50unattended-upgrades.j2 | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/host_vars/ptf.adm.crans.org.yml b/host_vars/ptf.adm.crans.org.yml index 3259f44f..373de3b3 100644 --- a/host_vars/ptf.adm.crans.org.yml +++ b/host_vars/ptf.adm.crans.org.yml @@ -10,12 +10,6 @@ loc_unattended: loc_needrestart: override: [] -loc_unattended: - reboot: true - -loc_needrestart: - override: [] - loc_nfs_mount: mounts: - ip: "{{ query('ldap', 'ip4', 'tealc', 'san') }}" diff --git a/plays/utilities.yml b/plays/utilities.yml index 8c62ee10..a786c8da 100755 --- a/plays/utilities.yml +++ b/plays/utilities.yml @@ -4,9 +4,13 @@ vars: root: "{{ glob_root | default({}) | combine(loc_root | default({})) }}" ntp_client: "{{ glob_ntp_client | combine(loc_ntp_client | default({})) }}" + needrestart: "{{ glob_needrestart | default({}) | combine(loc_needrestart | default({})) }}" + unattended: "{{ glob_unattended | default({}) | combine(loc_unattended | default({})) }}" roles: - root - common-tools - sudo - ntp-client - root-config + - needrestart + - unattended-upgrades diff --git a/roles/unattended-upgrades/templates/apt/apt.conf.d/50unattended-upgrades.j2 b/roles/unattended-upgrades/templates/apt/apt.conf.d/50unattended-upgrades.j2 index 558d7791..464d0d09 100644 --- a/roles/unattended-upgrades/templates/apt/apt.conf.d/50unattended-upgrades.j2 +++ b/roles/unattended-upgrades/templates/apt/apt.conf.d/50unattended-upgrades.j2 @@ -87,7 +87,7 @@ Unattended-Upgrade::Remove-Unused-Dependencies "true"; // Automatically reboot *WITHOUT CONFIRMATION* if // the file /var/run/reboot-required is found after the upgrade -Unattended-Upgrade::Automatic-Reboot "{{ unattended.automatic_reboot | default(false) | ternary("true", "false") }}"; +Unattended-Upgrade::Automatic-Reboot "{{ unattended.reboot | default(false) | ternary("true", "false") }}"; // Automatically reboot even if there are users currently logged in // when Unattended-Upgrade::Automatic-Reboot is set to true