--- - name: Add Docker GPG key apt_key: url: https://download.docker.com/linux/ubuntu/gpg state: present - name: Add Docker repository apt_repository: repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable state: present - name: Install Docker apt: name: docker-ce state: present update_cache: yes - name: Start and enable Docker service systemd: name: docker state: started enabled: true