From 64e4247347c64ada1c793821e23f228dfed11524 Mon Sep 17 00:00:00 2001 From: Sergey <6213510+sshnaidm@users.noreply.github.com> Date: Wed, 8 Jan 2025 15:38:03 +0200 Subject: [PATCH] Don't pull image when state is absent or pull=never (#889) fix #888 Signed-off-by: Sagi Shnaidman --- plugins/module_utils/podman/podman_container_lib.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/module_utils/podman/podman_container_lib.py b/plugins/module_utils/podman/podman_container_lib.py index 09287ff6..5a621be4 100644 --- a/plugins/module_utils/podman/podman_container_lib.py +++ b/plugins/module_utils/podman/podman_container_lib.py @@ -1734,8 +1734,9 @@ def __init__(self, module, params): required=True) self.image = self.module_params['image'] self.state = self.module_params['state'] + disable_image_pull = self.state in ('quadlet', 'absent') or self.module_params['pull'] == 'never' image_actions = ensure_image_exists( - self.module, self.image, self.module_params) if self.state != 'quadlet' else [] + self.module, self.image, self.module_params) if not disable_image_pull else [] self.results['actions'] += image_actions self.restart = self.module_params['force_restart']