Ansible failing to manage influxdb

I am facing issue with managing inflluxdb on remote host using influxdb_database module.

  • name: Create database
    influxdb_database:
    hostname: localhost
    database_name: miroslav

It is failing with following error:
“ImportError: No module named influxdb. Failed to import the required Python library (influxdb)”

When I run ansible on host where influxdb is running, it works fine. I suspect on bug in this module.
Does anyone have this module works when managing influxdb on remote host?

Hello,

the error appears because you're missing influxdb python module on the
host you're targeting with ansible.

Luca

Could you check versions of influxdb and python you are running on managed host?

Influx should be between versions 0.9 and 1.2.4, while python needs to be version 2.6:
https://docs.ansible.com/ansible/latest/modules/influxdb_database_module.html

Dana utorak, 11. kolovoza 2020. u 14:45:15 UTC+2 korisnik miroslav....@nutanix.com napisao je:

Could you check versions of influxdb and python you are running on managed host?

Influx should be between versions 0.9 and 1.2.4, while python needs to be version 2.6:
https://docs.ansible.com/ansible/latest/modules/influxdb_database_module.html

Version 2.6 or later :-), so this should be a given for most distributions.

Regards
       Racke

Hi,

Thank you Luca, you were right. I was missing influxdb in targeted host. I was assuming all the time that dependency referred to host where ansible was running.
Thank you a lot once again!

Miroslav