diff --git a/plugins/module_utils/_module_container/module.py b/plugins/module_utils/_module_container/module.py index 75128cfe..ca3db182 100644 --- a/plugins/module_utils/_module_container/module.py +++ b/plugins/module_utils/_module_container/module.py @@ -641,6 +641,7 @@ class ContainerManager(DockerBaseClass, t.Generic[Client]): if not image or self.param_pull == "always": if not self.check_mode: self.log("Pull the image.") + old_image = self.engine_driver.inspect_image_by_name(self.client, repository, tag) image, already_to_latest = self.engine_driver.pull_image( self.client, repository, @@ -655,7 +656,7 @@ class ContainerManager(DockerBaseClass, t.Generic[Client]): else: self.results["changed"] = True self._add_action( - {"pulled_image": f"{repository}:{tag}", "changed": True} + {"pulled_image": f"{repository}:{tag}", "changed": True, "old": old_image, "new": image} ) elif not image or self.param_pull_check_mode_behavior == "always": # If the image is not there, or pull_check_mode_behavior == 'always', claim we'll