---
# Common role — OS setup, Docker, firewall, fail2ban

- name: Update apt cache
  ansible.builtin.apt:
    update_cache: true
    cache_valid_time: 3600

- name: Install base packages
  ansible.builtin.apt:
    name: "{{ common_packages }}"
    state: present

- name: Set timezone to UTC
  community.general.timezone:
    name: UTC

- name: Configure swap (if needed)
  ansible.builtin.include_tasks: swap.yml
  when: ansible_memtotal_mb < 3072

- name: Install Docker
  ansible.builtin.include_tasks: docker.yml

- name: Configure UFW firewall
  ansible.builtin.include_tasks: ufw.yml

- name: Configure fail2ban
  ansible.builtin.include_tasks: fail2ban.yml
