Skip to content

Commit

Permalink
Absent sources.list on noble
Browse files Browse the repository at this point in the history
On a fresh install, this is an empty file with a comment pointing to
/etc/apt/sources.list.d/ubuntu.sources and isn't needed.

In the upgrade case it doesn't make sense for us to create the empty
pointer file, so let's just ensure it's absent entirely.
  • Loading branch information
legoktm committed Nov 20, 2024
1 parent 4c9062b commit 01a9076
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions install_files/ansible-base/roles/common/tasks/apt_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@
tags:
- apt

# Remove the obsolete sources.list on noble. On a fresh install,
# this is an empty file with a comment pointing to ubuntu.sources.
# On upgrade from focal, we're deleting this file.
- name: Remove obsolete sources.list (noble)
template:
dest: /etc/apt/sources.list
state: absent
when: ansible_distribution_release != "focal"
notify: update apt cache
tags:
- apt

# Ensure apt cache is updated before proceeding, otherwise
# packages may fail to install.
- meta: flush_handlers

0 comments on commit 01a9076

Please sign in to comment.