Forum Discussion

tatmotiv's avatar
tatmotiv
Icon for Cirrostratus rankCirrostratus
Sep 03, 2015

ansible missing json module on big IP: how to install?

Hi all.

I'm curently trying to get ansible running and returning data from my Big IPs (all running 11.6.0 HF5). Since there are some prebuild f5 functions coming with ansible out of the box, I was under the impression that this was easy going, but it seems I was wrong...

While the raw module works properly after preparing proper SSL keys and hosts file for ansible, all the f5 specific and other modules (such as file) fail executing on the big IPs because of a missing json module:

$ ansible f5-test-LBs -m bigip_facts

lb-lbtest1 | FAILED >> {
    "failed": true, 
    "msg": "Error: ansible requires a json module, none found!", 
    "parsed": false
}

After a bit of googling, I found out that installing the simplejson python module on the target platform will resolve this issue. Hence, I downloaded a copy of simplejson for python 2.4 and, after a bit of struggling around, succeded in installing it on the big IP. The package is now located in /var/lib/python2.4/site-packages. I added this directory to $PYTHONPATH and python itself is able to load the module when being exectuted directly on the big IP:

[root@lb-LBTEST1:/S1-green-P:Standby:In Sync] config  echo $PYTHONPATH
/var/lib/python2.4/:/var/lib/python2.4/site-packages/:/usr/lib/python2.4/:/usr/lib/python2.4/site-packages/

[root@lb-LBTEST1:/S1-green-P:Standby:In Sync] config  cd /var/lib/python2.4/site-packages/

[root@lb-LBTEST1:/S1-green-P:Standby:In Sync] site-packages  ls
easy-install.pth  setuptools-0.6c11-py2.4.egg  setuptools.pth  **simplejson-2.1.0-py2.4.egg**  site.py  site.pyc

[root@lb-LBTEST1:/S1-green-P:Standby:In Sync] site-packages  python -i
Python 2.4.3 (1, Aug 11 2014, 20:44:34) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import simplejson
>>> simplejson.__name__
'simplejson'
>>> simplejson.__version__
'2.1.0rc3'

Unfortunately, the error with ansible still persists the same way as before.

Is anybody here successfully using ansible to manage their Big IPs? If so, can you point out what steps you have taken in order to make it running? Is there any general recommendation for installing custom python modules on the Big IP? Any hint is welcome! Thanks in advance.

5 Replies

  • << Is there any general recommendation for installing custom python modules on the Big IP? >>

     

    i would say, don't install anything on the BIG-IP, it isn't your normal *nix server and doing things like this can break existing functionality if done wrong.

     

  • The problem should be in your local machine, not in the F5 (being here, do not install anything into your LTM) I'd say is missing the python simplejson package likely due to it running a python version less than 2.6.

     

  • Right, agree with the above answers. Use Ansible modules (or write your own) which use the web interfaces that are supported for orchestrating BIG-IP (iControlREST, SOAP). The thing that makes Ansible powerful for management of network devices is the lack of need to install an agent.