From b75205f96c91474c01f3767dce529c133595c373 Mon Sep 17 00:00:00 2001 From: Stefan Haun Date: Sat, 16 Jul 2022 16:39:28 +0200 Subject: [PATCH] Use template to replace Docker apt list entry --- roles/docker_setup/tasks/main.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/roles/docker_setup/tasks/main.yml b/roles/docker_setup/tasks/main.yml index 2d3a475..43c8614 100644 --- a/roles/docker_setup/tasks/main.yml +++ b/roles/docker_setup/tasks/main.yml @@ -29,11 +29,15 @@ state: present - name: add Docker's APT repository - apt_repository: - repo: deb https://download.docker.com/linux/debian buster stable - state: present + ansible.builtin.template: + src: templates/docker.list.j2 + dest: /etc/apt/sources.list.d/docker.list + register: apt_repo + +- name: Update package cache + ansible.builtin.apt: update_cache: true - filename: "docker" + when: apt_repo.changed - name: install Docker package: