Skip to content

Commit e65d835

Browse files
author
Derek
committed
feat: Disable Ubuntu Pro/ESM advertising messages
Removes promotional messages from: - apt update/upgrade output (20apt-esm-hook.conf) - MOTD login messages (91-contract-ua-esm-status) - apt news via pro config
1 parent 241fd19 commit e65d835

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

ansible/roles/dfe_developer/tasks/utilities.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,32 @@
170170
- ansible_distribution in ['Fedora', 'Ubuntu']
171171
- dfe_has_gnome | default(false)
172172

173+
# ============================================================================
174+
# DISABLE UBUNTU PRO/ESM ADVERTISING (Ubuntu only)
175+
# ============================================================================
176+
# Removes promotional messages from apt output and MOTD
177+
178+
- name: Disable Ubuntu Pro advertising
179+
block:
180+
- name: Disable apt ESM hook (removes apt upgrade messages)
181+
ansible.builtin.file:
182+
path: /etc/apt/apt.conf.d/20apt-esm-hook.conf
183+
state: absent
184+
185+
- name: Disable ESM MOTD message
186+
ansible.builtin.file:
187+
path: /etc/update-motd.d/91-contract-ua-esm-status
188+
state: absent
189+
190+
- name: Disable Ubuntu Pro apt news
191+
ansible.builtin.command:
192+
cmd: pro config set apt_news=false
193+
register: pro_apt_news
194+
changed_when: "'Successfully' in pro_apt_news.stdout"
195+
failed_when: false
196+
197+
when: ansible_distribution == 'Ubuntu'
198+
173199
# ============================================================================
174200
# DFE ADMIN TOOLS
175201
# ============================================================================

0 commit comments

Comments
 (0)