--- - name: Update web servers hosts: all remote_user: root tasks: - name: Install a list of packages ansible.builtin.apt: pkg: - ca-certificates - curl - gnupg - name: Download /etc/apt/keyrings/docker.gpg ansible.builtin.get_url: url: https://download.docker.com/linux/debian/gpg dest: /etc/apt/keyrings/docker.gpg mode: '0440' - name: Add docker repository ansible.builtin.apt_repository: repo: "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable" state: present - name: Install a list of packages ansible.builtin.apt: update_cache: yes pkg: - docker-ce - docker-ce-cli - containerd.io - docker-buildx-plugin - docker-compose-plugin - docker-compose