molecule
can create containers or VMs to test ansible roles.
I am using containers which run systemd to test the role in multiple environments.
To run systemd I am using the command:
option but in one container i cannot do that because of the ENTRYPOINT
set on the container. This is the relevant extract from molecule/default/molecule.yml
:
---
driver:
name: podman
platforms:
- name: some_platform
image: "docker.io/someuser/some_image:version"
entrypoint: /lib/systemd/systemd # does not work on molecule[podman]
- name: some_platform
image: "docker.io/someuser/some_image:version"
entrypoint:
- /lib/systemd/systemd # does not work on molecule[podman]
- name: some_platform
image: "docker.io/someuser/some_image:version"
# I thought maybe this would work because of
# https://github.com/containers/podman/issues/4595
entrypoint: ["/lib/systemd/systemd"] # does not work on molecule[podman]
Is there any way to override the entrypoint from molecule.yml
and podman driver?
I had the same issue and solved it by manually running the podman container before launching molecule converge. I'm using "docker.io/geerlingguy/docker-ubuntu2004-ansible", which works perfectly fine :D
Thus, in your case, first start a podman container named "some_platform"
Adjust your converge.yml file as follows:
And finally, run your molecule converge: