Giter VIP home page Giter VIP logo

Comments (5)

sshnaidm avatar sshnaidm commented on August 18, 2024 3

@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:

  1. 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.
  2. 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.

manics avatar manics commented on August 18, 2024 2

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.

sshnaidm avatar sshnaidm commented on August 18, 2024

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.

yajo avatar yajo commented on August 18, 2024

I think the easiest path depends on how the docker modules are implemented.

  1. 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.
  2. 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.

ReinerNippes avatar ReinerNippes commented on August 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.