semaphore/roles/linux/tasks/apt_source.yml
2024-08-12 01:22:12 +08:00

50 lines
1.2 KiB
YAML

######################################################
# Manage APT Sources
######################################################
- name: Manage /etc/apt/sources.list
ansible.builtin.template:
src: sources.list.j2
dest: /etc/apt/sources.list
owner: root
group: root
mode: 0755
when: ansible_facts['distribution'] == "Debian"
notify: apt_update
- name: Manage /etc/apt/apt.conf.d/no-bookworm-firmware.conf
ansible.builtin.copy:
src: no-bookworm-firmware.conf
dest: /etc/apt/apt.conf.d/no-bookworm-firmware.conf
owner: root
group: root
mode: 0644
when:
- ansible_facts['distribution'] == "Debian"
- ansible_facts['distribution_major_version'] == "12"
notify: apt_update
- name: Remove /etc/apt/sources.list.d/security_debian_org_debian_security.list
ansible.builtin.file:
path: /etc/apt/sources.list.d/security_debian_org_debian_security.list
state: absent
- name: Update all packages to their latest version
ansible.builtin.apt:
name: "*"
state: latest
changed_when: false
- name: Autoremove no longer needed packages
ansible.builtin.apt:
autoremove: yes
changed_when: false
- name: Autoclean cache
ansible.builtin.apt:
autoclean: yes
changed_when: false