From ac1cf5ace74ccd8ece8eae0ca4165b1ae0eee282 Mon Sep 17 00:00:00 2001 From: Max Gautier Date: Fri, 8 Mar 2024 12:58:55 +0100 Subject: [PATCH] Fix dpkg_selection on non-existing packages Needed since ansible-core>2.16, see: https://github.com/ansible/ansible/commit/f10d11bcdc54c9b7edc0111eb38c59a88e396d0a --- roles/container-engine/docker/tasks/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/roles/container-engine/docker/tasks/main.yml b/roles/container-engine/docker/tasks/main.yml index 1fc490b12e5..3d2408d4e46 100644 --- a/roles/container-engine/docker/tasks/main.yml +++ b/roles/container-engine/docker/tasks/main.yml @@ -96,7 +96,10 @@ name: "{{ item }}" selection: install when: ansible_pkg_mgr == 'apt' - changed_when: false + register: ret + failed_when: + - ret is failed + - ret.msg != ( "Failed to find package '" + item + "' to perform selection 'install'." ) with_items: - "{{ containerd_package }}" - docker-ce