# roles/system/tasks/main.yml
---
- name: Update apt package index (Debian-based)
  apt:
    update_cache: yes
    cache_valid_time: "{{ '1d' | community.general.to_time_unit('seconds') | int }}"
  when: ansible_facts['os_family'] == 'Debian'

- name: Ensure Python is installed on Debian-based systems
  apt:
    name: python3
    state: present
  when: ansible_facts['os_family'] == 'Debian'