How to use this collection for a simple create and update container workflow #514
Replies: 2 comments 12 replies
-
I think just running the same task should be fine. But use - name: Run container
containers.podman.podman_container:
name: container1
image: testimg
state: started
command: sleep 3h
image_strict: true
volumes:
- /tmp/test:/test
ports:
- 10025:10025
register: container1 Change |
Beta Was this translation helpful? Give feedback.
-
Thanks, I will test it. The documentation of this option I expected an option more explicit, like Thanks again. :) |
Beta Was this translation helpful? Give feedback.
-
Hello,
I use this collection on a few playbooks and roles, but there is a simple workflow for which I still have doubts on how to do it.
What I want to do
What I want to do is simple:
An image is considered updated if the digest in the local storage is different than the one of the remote image.
What I think to do
After reading the documentation of this collection, all I can think is something like that:
But I don't know if it will work when an update will be available. Maybe the recreation of the container make it lose all its settings. Maybe it will not work for another reason.
I can't found enough information in the doc to help me found a simple way to do my workflow.
A better way ?
And, is it the best way ? For a simple workflow like this, should we have a simple setting in
podman_container
to do it with a single task ?Like a
image_update
setting that manage the recreation of the container when an update of the image is available ?With this option, the previous workflow will be:
Beta Was this translation helpful? Give feedback.
All reactions