Skip to content
Snippets Groups Projects
Unverified Commit acc5e579 authored by Lihai Tu's avatar Lihai Tu Committed by GitHub
Browse files

Add conditional checking on ubuntu kernel unattended_upgrades disabling (#11479)


Signed-off-by: default avatartu1h <lihai.tu@daocloud.io>
parent 60b323b1
No related branches found
No related tags found
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment