-
-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publish option short-hand always recreates container #116
Comments
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 |
@roxifas ok, so after some clarifications in containers/podman#7947 we found out that if you set only one port |
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 |
@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 "PortBindings": {
"3360/tcp": [
{
"HostIp": "",
"HostPort": "43234"
}
]
}, and no way to know if there is chosen by podman or user port. |
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. |
Yes, it's worth to mention in docs. |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
The
publish
option will always trigger a container recreate if it's defined in the short-hand form, for example:But the below works correctly:
Steps to reproduce the issue:
Describe the results you received:
Container is always recreated despite configuration not being changed.
Describe the results you expected:
Container should not be recreated if the configuration is the same.
Output of
ansible --version
:Output of
podman version
:Output of
podman info --debug
:Content
Package info (e.g. output of
rpm -q podman
orapt list podman
):Playbok you run with ansible (e.g. content of
playbook.yaml
):Command line and output of ansible run with high verbosity:
Redacted because it contained sensitive information, but I think this diff tells the story rather accurately:
Additional environment details (AWS, VirtualBox, physical, etc.):
Target environment is a CentOS VPS.
The text was updated successfully, but these errors were encountered: