Reply

Issues with infoblox-client in Ansible.

LennertB
Techie
Posts: 1
261     0

Hi!

 

I experience some issues using the infoblox-client in Ansible. We want to automate some of our Infoblox tasks and I'm trying to do just that with the help of Ansible.

 

I created an initial playbook using the "lookup" module provided by the infoblox-client to fetch a host record. But upon running the playbook i get the following error/message:

 

fatal: [***.***.***.***]: FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'nios'. Error was a <type 'exceptions.Exception'>, original message: infoblox-client is required but does not appear to be installed.  It can be installed using the command `pip install infoblox-client`"}

This is strange because the infoblox-client module has been installed and is listed when performing the "pip list" command.

 

The playbook looks as followed:

 

 

---
- hosts: ********
  connection: local
  vars:
    nios_provider:
      host: ********
      username: ********
      ssl_verify: no
  tasks:
    - name: Fetch host test
      set_fact:
         host: "{{ lookup('nios', 'record:host', filter={'name': 'test.ansible.com'}, provider=nios_provider) }}"
...

Anybody has experience with this issue or knows how to deal with it?

 

Thanks in advance

 

Lennert

 

Re: Issues with infoblox-client in Ansible.

Posts: 3
261     0

Hey Lennert,

 

I'm not posting the solution, but if you have got the soluation from somewhere else, please let me know here.

I'm also facing the same issue and I'm totally stuck.

TIA

Re: Issues with infoblox-client in Ansible.

TTiscareno Community Manager
Community Manager
Posts: 361
261     0

The infoblox-client package is the interface for the RESTful API (WAPI) connection to NIOS and requires Python version 2.6 or newer to work properly. If you have the infoblox-client package installed but are still seeing this error, the next thing that I would check is that Python is installed and has been updated to a compatible version.

 

Regards,

Tony

Re: Issues with infoblox-client in Ansible.

Posts: 3
261     0

Tony,

 

I am currently using Python version 3.6.3 with ansible and still getting the error.

Is there anything else I need to check or install or validate? 

 

Regards,

Abhinav 

Re: Issues with infoblox-client in Ansible.

TTiscareno Community Manager
Community Manager
Posts: 361
261     0

It may be that you are missing another dependency that is covered by default in the builds I have tested with. Try installing python-dev to see if that helps clear the error.

 

Regards,

Tony

Re: Issues with infoblox-client in Ansible.

Posts: 3
261     0

Installed python-devel package with latest version, still no luck with eliminating the error.

Re: Issues with infoblox-client in Ansible.

Adviser
Posts: 79
261     0

Hi,

 

The issue you see could be because you use python 3.6, but you installed the infoblox-client with pip (which uses 2.x version). You can re-install the client using pip3 as below (if pip3 is not present on your system, first install it using apt install python3-pip):

pip3 install infoblox-client

pip3 show infoblox-client
---
Metadata-Version: 2.1
Name: infoblox-client
Version: 0.4.22
Summary: Client for interacting with Infoblox NIOS over WAPI
Home-page: https://github.com/infobloxopen/infoblox-client
Author: John Belamaric
Author-email: jbelamaric@infoblox.com
Installer: pip
License: Apache
Location: /usr/local/lib/python3.5/dist-packages
Requires: setuptools, urllib3, requests, oslo.log, oslo.serialization
Classifiers:
  Development Status :: 3 - Alpha
  Intended Audience :: Developers
  License :: OSI Approved :: Apache Software License
  Natural Language :: English
  Programming Language :: Python :: 2
  Programming Language :: Python :: 2.7
  Programming Language :: Python :: 3
  Programming Language :: Python :: 3.4
  Programming Language :: Python :: 3.5
  Programming Language :: Python :: 3.6

Hope this helps,

Krishna

 

Highlighted

Re: Issues with infoblox-client in Ansible.

[ Edited ]
justincline
Techie
Posts: 1
261     0

Anyone get it working? I am seeing the same issue. (I used pip3 so not that)

 

EDIT:

never mind... I found that ansible was using python2 so I was installing the mod in the wrong place... both pip, pip2 and pip3 were all installing it for python3.  "python2 -m pip install infoblox-client" did the trick to get it working until I switch ansible to python3

Showing results for 
Search instead for 
Do you mean 

Recommended for You