Skip to content
This repository has been archived by the owner on Jan 8, 2023. It is now read-only.

fix: allow publishing multiple ports #69

Merged
merged 2 commits into from
Aug 27, 2021

Conversation

yajo
Copy link
Contributor

@yajo yajo commented Aug 27, 2021

Before this patch, there were errors like this:

TASK [Wait for instance(s) creation to complete] *******************************
failed: [localhost] (item=server0) => {"ansible_job_id": "32404159520.106608", "ansible_loop_var": "item", "attempts": 1, "changed": true, "cmd": ["/usr/bin/podman", "--cgroup-manager=cgroupfs", "--storage-opt=overlay.mount_program=/usr/bin/fuse-overlayfs", "--storage-driver=overlay", "run", "-d", "--name", "server0", "--privileged=True", "--tmpfs=/run", "--tmpfs=/tmp", "--publish=127.0.0.1:2080:80--publish=127.0.0.1:2443:443", "--hostname=server0", "docker.io/geerlingguy/docker-ubuntu2004-ansible:latest", "/sbin/init"], "delta": "0:00:00.052629", "end": "2021-08-27 10:45:12.158853", "finished": 1, "item": {"ansible_job_id": "32404159520.106608", "ansible_loop_var": "item", "changed": true, "failed": false, "finished": 0, "item": {"cgroup_manager": "cgroupfs", "command": "/sbin/init", "image": "docker.io/geerlingguy/docker-ubuntu2004-ansible:latest", "name": "server0", "pre_build_image": true, "privileged": true, "published_ports": ["127.0.0.1:2080:80", "127.0.0.1:2443:443"], "storage_driver": "overlay", "storage_opt": "overlay.mount_program=/usr/bin/fuse-overlayfs", "tmpfs": ["/run", "/tmp"]}, "results_file": "/var/home/yajo/.ansible_async/32404159520.106608", "started": 1}, "msg": "non-zero return code", "rc": 125, "start": "2021-08-27 10:45:12.106224", "stderr": "Error: invalid port format - format is [[hostIP:]hostPort:]containerPort", "stderr_lines": ["Error: invalid port format - format is [[hostIP:]hostPort:]containerPort"], "stdout": "", "stdout_lines": []}

Published some ports on the default scenario, just to test it works.

Before this patch, there were errors like this:

```
TASK [Wait for instance(s) creation to complete] *******************************
failed: [localhost] (item=server0) => {"ansible_job_id": "32404159520.106608", "ansible_loop_var": "item", "attempts": 1, "changed": true, "cmd": ["/usr/bin/podman", "--cgroup-manager=cgroupfs", "--storage-opt=overlay.mount_program=/usr/bin/fuse-overlayfs", "--storage-driver=overlay", "run", "-d", "--name", "server0", "--privileged=True", "--tmpfs=/run", "--tmpfs=/tmp", "--publish=127.0.0.1:2080:80--publish=127.0.0.1:2443:443", "--hostname=server0", "docker.io/geerlingguy/docker-ubuntu2004-ansible:latest", "/sbin/init"], "delta": "0:00:00.052629", "end": "2021-08-27 10:45:12.158853", "finished": 1, "item": {"ansible_job_id": "32404159520.106608", "ansible_loop_var": "item", "changed": true, "failed": false, "finished": 0, "item": {"cgroup_manager": "cgroupfs", "command": "/sbin/init", "image": "docker.io/geerlingguy/docker-ubuntu2004-ansible:latest", "name": "server0", "pre_build_image": true, "privileged": true, "published_ports": ["127.0.0.1:2080:80", "127.0.0.1:2443:443"], "storage_driver": "overlay", "storage_opt": "overlay.mount_program=/usr/bin/fuse-overlayfs", "tmpfs": ["/run", "/tmp"]}, "results_file": "/var/home/yajo/.ansible_async/32404159520.106608", "started": 1}, "msg": "non-zero return code", "rc": 125, "start": "2021-08-27 10:45:12.106224", "stderr": "Error: invalid port format - format is [[hostIP:]hostPort:]containerPort", "stderr_lines": ["Error: invalid port format - format is [[hostIP:]hostPort:]containerPort"], "stdout": "", "stdout_lines": []}
```

Published some ports on the default scenario, just to test it works.
Copy link
Member

@ssbarnea ssbarnea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change is good but the only problem is that at this moment we do not run this sample scenario in our pipeline. We should also add a test for that and merge this change after that, so we know it works and it does not regress over time.

@ssbarnea ssbarnea added the bug This issue/PR relates to a bug. label Aug 27, 2021
@yajo
Copy link
Contributor Author

yajo commented Aug 27, 2021

But that doesn't seem like a blocker, right? You can test it locally and see it works.

Copy link
Member

@ssbarnea ssbarnea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When enabling the test took few minutes, i consider wise to wait. I added the test and still passed so we are good!

@ssbarnea ssbarnea merged commit 0066fe0 into ansible-community:main Aug 27, 2021
@yajo yajo deleted the fix-multi-port branch August 31, 2021 06:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue/PR relates to a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants