From 5bd89294bd7a0a070cd60eee6cd6879471b8b645 Mon Sep 17 00:00:00 2001 From: Gerd Riesselmann Date: Tue, 6 Feb 2024 20:40:12 +0100 Subject: [PATCH] #627 and #526: Fix problems with image version "latest" If image version is set to "latest" - there are changes on each run, even if nothing is really done - docker containers are restarted every time This is fixed here. However, this needs a change in using docker::run, which now needs an additional subscribe => Docker::Image[...]. See https://github.com/puppetlabs/puppetlabs-docker/issues/627 --- manifests/image.pp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/manifests/image.pp b/manifests/image.pp index 54534f6e..dc6ac8ee 100644 --- a/manifests/image.pp +++ b/manifests/image.pp @@ -147,6 +147,7 @@ logoutput => true, } } elsif $ensure == 'latest' or $image_tag == 'latest' or $force { + /* notify { "Check if image ${image_arg} is in-sync": noop => false, } @@ -159,14 +160,15 @@ provider => $exec_provider, logoutput => true, } - ~> exec { "echo 'Update of ${image_arg} complete'": + ~> */ exec { "echo 'Update of ${image_arg} complete'": environment => $exec_environment, path => $exec_path, timeout => $exec_timeout, require => File[$update_docker_image_path], provider => $exec_provider, logoutput => true, - refreshonly => true, + #refreshonly => true, + onlyif => $image_install, } } elsif $ensure == 'present' { exec { $image_install: