From f63860d9ce59b961e94d5561fb78bd69f96cdaf8 Mon Sep 17 00:00:00 2001 From: Anthony Perkins Date: Tue, 21 Feb 2023 14:17:21 +0000 Subject: [PATCH] Move from sources.list to debian.sources --- roles/debian/files/debian.sources.12 | 11 +++++++++++ roles/debian/files/sources.list.12 | 8 -------- roles/debian/tasks/apt-sources.yml | 20 +++++++++++++++++--- 3 files changed, 28 insertions(+), 11 deletions(-) create mode 100644 roles/debian/files/debian.sources.12 delete mode 100644 roles/debian/files/sources.list.12 diff --git a/roles/debian/files/debian.sources.12 b/roles/debian/files/debian.sources.12 new file mode 100644 index 0000000..646b9d4 --- /dev/null +++ b/roles/debian/files/debian.sources.12 @@ -0,0 +1,11 @@ +Types: deb deb-src +URIs: http://deb.debian.org/debian +Suites: bookworm bookworm-updates +Components: main non-free-firmware +Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg + +Types: deb deb-src +URIs: http://security.debian.org/debian-security/ +Suites: bookworm-security +Components: main non-free-firmware +Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg diff --git a/roles/debian/files/sources.list.12 b/roles/debian/files/sources.list.12 deleted file mode 100644 index a443313..0000000 --- a/roles/debian/files/sources.list.12 +++ /dev/null @@ -1,8 +0,0 @@ -deb http://deb.debian.org/debian/ bookworm main non-free-firmware -deb-src http://deb.debian.org/debian/ bookworm main non-free-firmware - -deb http://deb.debian.org/debian/ bookworm-updates main non-free-firmware -deb-src http://deb.debian.org/debian/ bookworm-updates main non-free-firmware - -deb http://security.debian.org/debian-security/ bookworm-security main non-free-firmware -deb-src http://security.debian.org/debian-security/ bookworm-security main non-free-firmware diff --git a/roles/debian/tasks/apt-sources.yml b/roles/debian/tasks/apt-sources.yml index 6b51a52..f0fae01 100644 --- a/roles/debian/tasks/apt-sources.yml +++ b/roles/debian/tasks/apt-sources.yml @@ -13,6 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. +- name: Create /etc/apt/sources.list.d + become: true + ansible.builtin.file: + path: /etc/apt/sources.list.d + state: directory + mode: '0755' + - name: Set APT sources.list for Debian 10 become: true ansible.builtin.copy: @@ -27,11 +34,18 @@ dest: "/etc/apt/sources.list" when: ansible_distribution_release == "bullseye" -- name: Set APT sources.list for Debian 12 +- name: Set APT debian.sources for Debian 12 become: true ansible.builtin.copy: - src: sources.list.12 - dest: "/etc/apt/sources.list" + src: debian.sources.12 + dest: "/etc/apt/sources.list.d/debian.sources" + when: ansible_distribution_release == "bookworm" + +- name: Remove /etc/apt/sources.list for Debian 12 + become: true + ansible.builtin.file: + path: /etc/apt/sources.list + state: absent when: ansible_distribution_release == "bookworm" - name: Update APT cache