--- - name: install apt key apt_key: url: "https://download.docker.com/linux/{{ ansible_lsb.id | lower }}/gpg" state: present - name: install apt repo apt_repository: repo: > deb [arch=amd64] https://download.docker.com/linux/{{ ansible_lsb.id | lower }} {{ ansible_lsb.codename }} stable filename: docker