Skip to content

Commit

Permalink
Recreate stopped containers if recreate flag is enabled
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
rebtoor committed Nov 21, 2023
1 parent 22e0c93 commit 9c70cd1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/module_utils/podman/podman_container_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1654,7 +1654,8 @@ def make_started(self):
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)
Expand Down

0 comments on commit 9c70cd1

Please sign in to comment.