--- - name: Install aptitude ansible.builtin.apt: name: aptitude state: latest update_cache: true - name: Install required system packages ansible.builtin.apt: pkg: - apt-transport-https - ca-certificates - curl - software-properties-common - python3-pip - virtualenv - python3-setuptools state: latest update_cache: true - name: Add Docker GPG apt Key ansible.builtin.apt_key: url: https://download.docker.com/linux/debian/gpg state: present - name: Add Docker Repository ansible.builtin.apt_repository: repo: deb https://download.docker.com/linux/debian bookworm stable state: present - name: Update apt and install docker-ce ansible.builtin.apt: name: docker-ce state: latest update_cache: true - name: Update apt and install docker-compose ansible.builtin.apt: name: docker-compose state: latest update_cache: true - name: Install Docker Module for Python ansible.builtin.pip: name: docker extra_args: --break-system-packages - name: adding existing user to group docker '{{ ansible_user }}' ansible.builtin.user: name: '{{ ansible_user }}' groups: docker append: true