Disable `Ubuntu Pro` announcement.

This commit is contained in:
Kazuhiro MUSASHI 2024-07-01 15:22:58 +09:00
parent 450426b12a
commit 1998a11c29
2 changed files with 14 additions and 0 deletions

View File

@ -70,6 +70,9 @@ include_recipe './starship.rb'
# Install cloudflared command: # Install cloudflared command:
include_recipe './cloudflared.rb' include_recipe './cloudflared.rb'
# Disable Ubuntu Pro
include_recipe './ubuntupro.rb'
# recipes for Ubuntu 20.04 and later # recipes for Ubuntu 20.04 and later
case node['platform_version'] case node['platform_version']
when "20.04", "22.04", "24.04" when "20.04", "22.04", "24.04"

View File

@ -0,0 +1,11 @@
case node['platform_version']
when "24.04"
directory "/etc/apt/apt.conf.d/bk/"
%w( 20apt-esm-hook.conf ).each do |conf|
execute "mv /etc/apt/apt.conf.d/#{conf} /etc/apt/apt.conf.d/bk/#{conf}"
execute "touch /etc/apt/apt.conf.d/#{conf}"
end
execute 'pro config set apt_news=false'
end