mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2025-12-13 21:34:40 +03:00
Add conditional checking on ubuntu kernel unattended_upgrades disabling (#11479)
Signed-off-by: tu1h <lihai.tu@daocloud.io>
This commit is contained in:
@@ -63,9 +63,17 @@
|
||||
- '"value from" in bootstrap_update_apt_result.stdout'
|
||||
ignore_errors: true
|
||||
|
||||
- name: Check unattended-upgrades file exist
|
||||
stat:
|
||||
path: /etc/apt/apt.conf.d/50unattended-upgrades
|
||||
register: unattended_upgrades_file_stat
|
||||
when:
|
||||
- os_release_dict['ID'] == 'ubuntu'
|
||||
- ubuntu_kernel_unattended_upgrades_disabled
|
||||
|
||||
- name: Disable kernel unattended-upgrades
|
||||
lineinfile:
|
||||
path: /etc/apt/apt.conf.d/50unattended-upgrades
|
||||
path: "{{ unattended_upgrades_file_stat.stat.path }}"
|
||||
insertafter: "Unattended-Upgrade::Package-Blacklist"
|
||||
line: '"linux-";'
|
||||
state: present
|
||||
@@ -73,3 +81,4 @@
|
||||
when:
|
||||
- os_release_dict['ID'] == 'ubuntu'
|
||||
- ubuntu_kernel_unattended_upgrades_disabled
|
||||
- unattended_upgrades_file_stat.stat.exists
|
||||
|
||||
Reference in New Issue
Block a user