Hello,
I’m trying to use community.routeros.api for the first time. I’m using a venv in which I installed ansible. Hopefully, I correctly updated community.routeros to 3.19.0. in it.
When running a simple task involving community.routeros.api module, I’ve got:
[ERROR]: Task failed: Module failed: Failed to import the required Python library (librouteros)
Also if you’re using a venv, you need to make sure that modules are actually using the venv. IIRC ansible-core doesn’t do that automatically when running modules against localhost.
If you install the module requirements (librouteros) also in that venv, Ansible modules running for localhost might not find that library because they are not running in the context of the venv.
If you installed librouteros in the venv (and not globally), you can try to run one of the API based modules and see whether it works. If it complains about missing librouteros, you will have to point Ansible to the venv somehow. If it runs (and maybe complains about something else, depending on your use), everything’s fine