ansible-community / molecule-plugins

Collection on molecule plugins
MIT License
109 stars 73 forks source link

synchronize module (rsync) not working with podman #81

Open Crystallic opened 3 years ago

Crystallic commented 3 years ago

Hey I got some issues by testing Ansible roles with synchronize module..

PLAY RECAP ********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
molecule_debian10          : ok=36   changed=2    unreachable=0    failed=1    skipped=6    rescued=0    ignored=0

fatal: [molecule_debian10]: FAILED! => {"changed": false, "msg": "synchronize uses rsync to function. rsync needs to connect to the remote host via ssh, docker client or a direct filesystem copy. This remote host is being accessed via podman instead so it cannot work."}

Is there any possibility to get the synchronize module from Ansible working with Molecule and podman? Or is there any indication of how long it will take for this feature to become available?

System Information: Debian10/Debian11/Archlinux (maybe any OS)

molecule --version
molecule 3.3.2 using python 3.9 
    ansible:2.9.21
    containers:0.2.1 from molecule_containers
    delegated:3.3.2 from molecule
    docker:0.2.4 from molecule_docker
    podman:0.3.0 from molecule_podman
podman --version
podman version 3.0.1
tadeboro commented 3 years ago

This is not really a Molecule issue. The underlying problem is the synchronize module itself that does not support the podman connection plugin (https://github.com/ansible-collections/ansible.posix/blob/a03e652437434fd9f600071bf99332ef4dd04292/plugins/action/synchronize.py#L199).

So this issue should be opened in the ansible.posix repo.

ssbarnea commented 3 years ago

At this moment we depend on https://github.com/ansible-collections/ansible.posix/issues/149 to make a new release, so we can do something require something like ansible.posix>=1.3.0 in order to close this bug.

@Crystallic I would recommend you to install ansible.posix from master and test, just to be sure that is enough in order to fix this bug.

tadeboro commented 3 years ago

I have a feeling that the issue is not fixed yet (https://github.com/ansible-collections/ansible.posix/pull/229#issuecomment-886178469).

Crystallic commented 3 years ago

hey sry for the late answer.. i will try to test it in the coming week :)

ssbarnea commented 3 years ago

@sshnaidm Do you think that synchronize works now with podman containers? Which version of the collection do we need in order to make use of that feature? Does it work with older versions of Ansible like 2.9 ?

sshnaidm commented 3 years ago

Yeah, it should work with release of ansible.posix 1.3.0. If you use syncronize module from ansible.posix collection with Ansible 2.9 (like ansible.posix.synchronize) it will work. But it wasn't ported to Ansible 2.9 of course.

ssbarnea commented 3 years ago

At this moment we only require https://github.com/ansible-community/molecule-podman/blob/main/src/molecule_podman/driver.py#L197 but i will make a change to also require ansible.posix 1.3.0 as the module use if not of much use without syncronize, as as most users will want to rsync stuff to the tested node in prepare.yml