---

- name: Configure apt for using local REPO
  block:
  - name: Copy sources.list with local REPO
    ansible.builtin.copy:
      src: files/debian12/sources.list
      dest: /etc/apt/sources.list
      owner: root
      group: root
      mode: '0644'
  - name: Run "apt-get clean"
    ansible.builtin.apt:
      clean: yes
  - name: Run "apt update" and NOT "apt upgrade"
    ansible.builtin.apt:
      upgrade: no
      update_cache: yes
  when: (ansible_os_family == "Debian" and ansible_distribution_major_version == "12")