- name: Install & configure Docker
  hosts: athelas
  become: true
  tasks:

  - name: Install ca-certificates & curl
    ansible.builtin.package:
      name:
        - ca-certificates
        - curl

  - name: Add Docker GPG Key
    ansible.builtin.get_url:
      url: https://download.docker.com/linux/debian/gpg
      dest: /etc/apt/keyrings/docker.asc
      mode: '0644'
      force: true

  - name: Add Docker repo
    ansible.builtin.apt_repository:
      repo: deb [signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian bookworm stable
      state: present

  - name: Install Docker
    ansible.builtin.package:
      name:
        - docker-ce
        - docker-ce-cli
        - containerd.io
        - docker-buildx-plugin
        - docker-compose-plugin
