--- - name: Install docker prerequisites become: true apt: name: - apt-transport-https - ca-certificates - curl - gnupg-agent - software-properties-common - vim - haveged - python3-pip - name: Add docker GPG apt key become: true apt_key: url: https://download.docker.com/linux/ubuntu/gpg state: present - name: Add docker PPA for Ubuntu {{ ansible_distribution_release }} become: true apt_repository: repo: deb https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable state: present - name: Update apt and install docker-ce become: true apt: name: docker-ce state: latest update_cache: true