Comments (6)
Yes, it's worth to mention in docs.
from ansible-podman-collections.
Seems like in podman 1.x versions the host port is random and in 2.x versions it's equal to container port. So in 1.x versions it will be like 3306:43728
, while in 2.x it's 3306:3306
. Need to workaround both versions.
Unfortunately it's impossible to know if 3306:43728
was set by user or it was random port, so the fix will be for 2.x versions only.
from ansible-podman-collections.
@roxifas ok, so after some clarifications in containers/podman#7947 we found out that if you set only one port 3360
it can be assigned to any random host port, for example 45362
. The fact it's assigned to the same 3360
is actually a bug and will be fixed by containers/podman#7951 soon.
Given that, I'm not sure what is the point to set only one port? It will be assigned to random host port and we can't know what it can be.
from ansible-podman-collections.
Well that's good to know, I had actually started building my scripts with the thought that the port would be the same 🤔 I guess there are some usecases where people will want to have a random port, and they would have their containers constantly recreated by ansible. So perhaps the fix would be to ignore a non-matching host port if the ansible playbook has only the container port defined, because it means that the host port will be random anyway and should not be a reason to recreate the container. What do you think? @sshnaidm
from ansible-podman-collections.
@roxifas the problem in this case that we can't detect for sure was it random port assigned by podman or non-random port assigned by user. For example some user can assign - 3360:43234
and other user can do - 3360
. In both cases in info it will be
"PortBindings": {
"3360/tcp": [
{
"HostIp": "",
"HostPort": "43234"
}
]
},
and no way to know if there is chosen by podman or user port.
The more I think about it the less I understand the logic behind the "randomness" of host port. But this is better to discuss in containers/podman#7947
from ansible-podman-collections.
If this information, about host port being random or not, is not stored anywhere, then this cannot really be fixed in the ansible module. It would be worth to mention this in the docs however, so that users do not get surprised by containers getting recreated unexpectedly.
from ansible-podman-collections.
Related Issues (20)
- [BUG] podman_image throws JSONDecodeError HOT 2
- Not idemponent when port is bound to `0.0.0.0` HOT 2
- Alias parameters "stop_timeout" and "time" for podman generate systemd HOT 3
- rootless always want to change the user HOT 3
- Incorrect documentation for `podman_image_info` return value HOT 1
- containers.podman.podman_secret fails if identical secret was create in playbook before HOT 1
- podman_network not idempotent when disable_dns is explicitly set
- No values returned from podman_container_exec on failures HOT 3
- `AttributeError: 'list' object has no attribute 'get'` trying to use collection on recent Fedora (podman 5.0?) HOT 2
- Env in container exec are wrongly double quoted HOT 2
- podman_container: pasta network breaks idempotency
- podman_login: why are tlsverify certdir mutually exclusive? HOT 6
- podman_pod_info raises JSONDecodeError for non-existant pod HOT 3
- Pushing an image with `/` in the name to a remote registry does not work HOT 4
- Issues pulling images with similar tags (cannot pull one with a shorter left substring than a pre-existing image) HOT 2
- podman network: support for "--route" option HOT 1
- podman_container: support for "--pull" option HOT 4
- Absent state with quadlet should remove quadlet file as well as podman resource. HOT 1
- Wrong Podman Secret Creation Behavior HOT 3
- Support shm-size when specifying a pod
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-podman-collections.