-
Notifications
You must be signed in to change notification settings - Fork 26
Configure podman networks #38
Configure podman networks #38
Conversation
This feature allow to use static IP in scenarios
…e-podman into ansible-community-master
The real purpose of this commit it to try to unlock the checks in the github PR: ansible-community#33
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since Ansible 2.9 is still supported, I think we should add support for this functionality in such a way that does not exclude users of Ansible 2.9.
failed_when: false | ||
|
||
- name: Create podman network dedicated to this scenario | ||
containers.podman.podman_network: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
I have no idea how to implement this feature without the podman_network module. |
As far as I can tell, there are two possible ways forward:
Both options are fine with me, but since I am not a maintainer, I cannot tell which one is prefferable. |
IMHO, i am inclined to add code that detects missing collection and require user to install it, eventually even its version. I doubt we have the ability to maintain two versions of the podman modules, so we can consider that podman driver works only with the latest collection, and not with the embedded (outdated) versions from ansible 2.9. |
To make matters even worse, Ansible 2.9 is actually missing a lot of content from the podman collection. The In this case, I think this PR is OK, but we should probably add code that makes sure collection is installed before merging this. |
Do we check the version of the collection |
I wonder if it's only module that can use collections. If not - probably we can install collection as a external dependency like we do with any pip module. It's a mess to have it implemented with podman commands when we have a collection. |
The problem is that in 2.9 there are no any podman collections. (only podman image module) |
I would keep things simple and always require podman collection. Anisble 2.9 can work well enough with collections that this should not be a problem. |
Adds utility method that detects if a collection is installed or if it outdated and exits. This functionality is not directly used by the linter yet but putting this code near similar prerun method makes it easier to reuse in other related projects. Related: ansible-community/molecule-podman#38
Adds utility method that detects if a collection is installed or if it outdated and exits. This functionality is not directly used by the linter yet but putting this code near similar prerun method makes it easier to reuse in other related projects. Related: ansible-community/molecule-podman#38
Adds utility method that detects if a collection is installed or if it outdated and exits. This functionality is not directly used by the linter yet but putting this code near similar prerun method makes it easier to reuse in other related projects. Related: ansible-community/molecule-podman#38
@ssbarnea thanks for the utility method require_collection. But how and where should I use it? |
Adds utility method that detects if a collection is installed or if it outdated and exits. This functionality is not directly used by the linter yet but putting this code near similar prerun method makes it easier to reuse in other related projects. Related: ansible-community/molecule-podman#38
@laurent-indermuehle You don't need to do it yourself, we already merged that. Now your code should run fine and fail nicely if requires collection is missing or outdated. |
@ssbarnea oh I see! Thanks for your work! Glad I could add some features! Have a nice day. |
This pull request adds Podman network options that allow usage of static IP in containers. And also add Detach mode support.
With the following molecule.yml you can write scenarios that tests communication between containers without relying on complicated DNS setup:
It is impossible to change the /etc/hosts file on a running container. This is why I edited the create.yml Playbook to add this feature.