1
0
Fork 0
mirror of https://github.com/containers/ansible-podman-collections.git synced 2026-03-22 02:29:08 +00:00

Recreate stopped containers if recreate flag is enabled (#669)

If `recreate` flag is enabled we should be able to (force) recreate stopped
containers even if they're configuration isn't changed.

Signed-off-by: Roberto Alfieri <ralfieri@redhat.com>
This commit is contained in:
Roberto Alfieri 2023-11-28 09:14:24 +01:00 committed by GitHub
parent 6c87654f7f
commit b693cb6b89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 1 deletions

View file

@ -1659,7 +1659,8 @@ class PodmanManager:
self.results['actions'].append('started %s' % self.container.name)
self.update_container_result()
return
elif self.container.stopped and self.container.different:
elif self.container.stopped and \
(self.container.different or self.recreate):
self.container.recreate_run()
self.results['actions'].append('recreated %s' %
self.container.name)