Comments (5)
@manics thanks, that's a really important question. A lot of tasks rely on docker
module outputs and of course it shouldn't break.
I think there could be a few approaches:
- Podman project tries to be compliant with docker outputs and if we see inconsistency or difference, we can always report it. Of course not everything could and should be fixed.
- We can catch podman output and if there are well known issues, just hack it to be compatible with docker output format. The same we should do with input arguments if there are different names for example.
Regarding option to explicitly set an engine, I think it would be totally reasonable to have it, like use_engine: docker
use_engine: podman
.
The main goal of course will be to make them their outputs and functionality as close as possible.
from ansible-podman-collections.
Would any of these options include unifying the output of the modules- or is the assumption that podman would change to match the docker output? For example to lookup an exposed port at the moment:
- docker_container:
registered_fact.ansible_facts.docker_container.NetworkSettings.Ports['8888/tcp'].0.HostPort
- containers.podman.podman_container:
registered_fact.container.NetworkSettings.Ports.0.hostPort
If it's not feasible to have them behave identically could the Ansible service module be an example to follow- if you're doing something simple use the generic module/wrapper, but if you depend on particular outputs or features use e.g. the systemd module instead?
from ansible-podman-collections.
Amazingly, option 2 works as is:
- name: Run docker hidden in podman
containers.podman.podman_container:
name: test-container
image: alpine
state: present
executable: docker
env:
MYSQL_ROOT_PASSWORD: "2211"
"podman_actions": [
"docker run --name test-container --env MYSQL_ROOT_PASSWORD=2211 --detach=True alpine"
]
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
13a5bc49ead3 alpine "/bin/sh" 21 minutes ago Exited (0) 21 minutes ago test-container
So a little action plugin which will replace executable
and maybe some options is very doable.
from ansible-podman-collections.
I think the easiest path depends on how the docker modules are implemented.
- If those modules call docker CLI, then just add support for a variable that indicates the CLI program to use. Then pass that variable to the role before running.
- If those modules call docker API, then just run podman v2 API server and add the
DOCKER_HOST
environment variable pointing to podman's socket before running the role.
from ansible-podman-collections.
So if you want to replace docker with podman with your collection in ansible playbooks:
How to port my playbook? https://github.com/ReinerNippes/selfhosted_on_docker
Just pulling and starting a container isn't enough. You have to provide also networking similar to docker.
Do you see any chance for this in the near future?
from ansible-podman-collections.
Related Issues (20)
- Absent state with quadlet should remove quadlet file as well as podman resource. HOT 3
- Wrong Podman Secret Creation Behavior HOT 3
- Support shm-size when specifying a pod
- Pod not idemponent when port is bound to 0.0.0.0/ maybe same as issue #679
- quadlet creates wrong healthcheck command for container HOT 1
- `podman_container`: using YAML dictionaries for options in the `secrets` parameter HOT 4
- Idempotency problem in collection version `1.15.0` when creating pods HOT 2
- podman_container is not idempotent due to cgroups, sdnotify and cidfile HOT 3
- Podman collection does not work on my development environment HOT 1
- Add examples of using connection plugin into documentation
- rootless always want to change the env HOT 4
- podman_network ignore dns when using quadlet HOT 4
- cli options from container command treated as podman arguments for idempotency HOT 2
- Unable to build custom image HOT 2
- containers.podman.podman_container is creating a systemd unit with invalid parameter for Podman 5.x
- idempotency broken with command in podman_container HOT 6
- podman_image build doesn't respect `arch` parameter HOT 1
- Quadlet filename set for podman_container but not podman_containers HOT 1
- Quadlet Label Value Truncation Due to Missing Quotes HOT 1
- Check Mode Actually Creates Quadlet Container File
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.