Skip to content

Commit 0a0c9ff

Browse files
author
Derek
committed
feat: Disable telemetry and advertising for corporate deployments
Ubuntu: - Disable apt ESM/Pro advertising hooks - Disable MOTD news fetching (Canonical ads) - Disable Apport crash reporting - Stop Whoopsie error reporting service - Opt out of Ubuntu Report telemetry Fedora: - Disable ABRT crash reporting services (5 services) GNOME (both): - Disable problem reporting - Disable software usage stats Also fixed include_tasks apply:tags for utilities.yml to ensure child tasks run when --tags utilities is used.
1 parent 7cc932e commit 0a0c9ff

2 files changed

Lines changed: 96 additions & 3 deletions

File tree

ansible/roles/dfe_developer/tasks/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
- name: Install development utilities
2626
ansible.builtin.include_tasks:
2727
file: utilities.yml
28+
apply:
29+
tags: ['utilities']
2830
tags: ['utilities']
2931

3032
- name: Install Python development tools

ansible/roles/dfe_developer/tasks/utilities.yml

Lines changed: 94 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,17 @@
171171
- dfe_has_gnome | default(false)
172172

173173
# ============================================================================
174-
# DISABLE UBUNTU PRO/ESM ADVERTISING (Ubuntu only)
174+
# DISABLE TELEMETRY AND ADVERTISING (Corporate deployment)
175175
# ============================================================================
176-
# Removes promotional messages from apt output and MOTD
176+
# Removes promotional messages, crash reporting, and telemetry for privacy
177+
# and to prevent data leakage in corporate environments.
177178

178-
- name: Disable Ubuntu Pro advertising
179+
# -----------------------------------------------------------------------------
180+
# UBUNTU: Disable Ubuntu Pro/ESM advertising and telemetry
181+
# -----------------------------------------------------------------------------
182+
- name: Disable Ubuntu advertising and telemetry
179183
block:
184+
# --- Ubuntu Pro/ESM Advertising ---
180185
- name: Disable apt ESM hook (removes apt upgrade messages)
181186
ansible.builtin.file:
182187
path: /etc/apt/apt.conf.d/20apt-esm-hook.conf
@@ -194,8 +199,94 @@
194199
changed_when: "'Successfully' in pro_apt_news.stdout"
195200
failed_when: false
196201

202+
# --- MOTD Advertising (Canonical news/ads) ---
203+
- name: Disable MOTD news fetching
204+
ansible.builtin.lineinfile:
205+
path: /etc/default/motd-news
206+
regexp: '^ENABLED='
207+
line: 'ENABLED=0'
208+
create: true
209+
mode: '0644'
210+
211+
# --- Apport (crash reporting to Canonical) ---
212+
- name: Disable Apport crash reporting
213+
ansible.builtin.lineinfile:
214+
path: /etc/default/apport
215+
regexp: '^enabled='
216+
line: 'enabled=0'
217+
218+
- name: Stop and disable Apport service
219+
ansible.builtin.systemd:
220+
name: apport
221+
state: stopped
222+
enabled: false
223+
failed_when: false
224+
225+
# --- Whoopsie (error reporting daemon) ---
226+
- name: Stop and disable Whoopsie error reporting
227+
ansible.builtin.systemd:
228+
name: whoopsie
229+
state: stopped
230+
enabled: false
231+
failed_when: false
232+
233+
# --- Ubuntu Report (first-run telemetry) ---
234+
- name: Opt out of Ubuntu Report telemetry
235+
ansible.builtin.command:
236+
cmd: ubuntu-report send no
237+
register: ubuntu_report
238+
changed_when: ubuntu_report.rc == 0
239+
failed_when: false
240+
197241
when: ansible_distribution == 'Ubuntu'
198242

243+
# -----------------------------------------------------------------------------
244+
# FEDORA: Disable ABRT and telemetry
245+
# -----------------------------------------------------------------------------
246+
- name: Disable Fedora telemetry
247+
block:
248+
# --- ABRT (crash reporting to Red Hat) ---
249+
- name: Disable ABRT crash reporting services
250+
ansible.builtin.systemd:
251+
name: "{{ item }}"
252+
state: stopped
253+
enabled: false
254+
loop:
255+
- abrt-journal-core
256+
- abrt-oops
257+
- abrt-xorg
258+
- abrt-vmcore
259+
- abrt-pstoreoops
260+
failed_when: false
261+
262+
# --- Fedora Third Party Repos (optional, keep enabled for Chrome etc) ---
263+
# Not disabling fedora-third-party as it's useful for Chrome, Steam, etc.
264+
265+
when: ansible_distribution == 'Fedora'
266+
267+
# -----------------------------------------------------------------------------
268+
# GNOME: Disable desktop telemetry (both distros)
269+
# -----------------------------------------------------------------------------
270+
- name: Disable GNOME telemetry
271+
block:
272+
- name: Disable GNOME problem reporting
273+
community.general.dconf:
274+
key: "/org/gnome/desktop/privacy/report-technical-problems"
275+
value: "false"
276+
state: present
277+
become: false
278+
279+
- name: Disable GNOME software usage stats
280+
community.general.dconf:
281+
key: "/org/gnome/desktop/privacy/send-software-usage-stats"
282+
value: "false"
283+
state: present
284+
become: false
285+
286+
when:
287+
- ansible_distribution in ['Fedora', 'Ubuntu']
288+
- dfe_has_gnome | default(false)
289+
199290
# ============================================================================
200291
# DFE ADMIN TOOLS
201292
# ============================================================================

0 commit comments

Comments
 (0)