For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

Anthony_Cheng_1's avatar
Anthony_Cheng_1
Icon for Nimbostratus rankNimbostratus
Aug 13, 2015

ANSIBLE error /w JSON

I was running a simple playbook from Ansible site (https://docs.ansible.com/ansible/bigip_facts_module.html) but then I get an error saying "Error: ansible requires a json module, none found!".

 

I was under the impression that Ansible only requires bigsuds for this F5 playbook which I have installed (got python working) as it doesn't list any JSON dependency. I also installed python-simplejson on the Ansible box. Googling around suggests that I need to install "python-simplejson" which in this case would be on the F5 itself?

 

p.s this is on 11.6

 

5 Replies

  • I ran exactly into the same issue. It's also my understanding that Ansible requires some json packages on the big IP, which would make it rather useless, since I will certainly not install any third party software on the big IPs. Anybody using ansible with f5 here who can point us into the right direction?

     

  • The reason this is happening is because you are probably trying to run the module directly on the BIG-IP (due to a hosts: line entry that includes the BIG-IP).

    This will not work though because, indeed, BIG-IP 11.6 indeed does not have a json library where this is going to work

    The correct way to use the module is to delegate its usage to a machine that does have JSON, for example, localhost. For example.

    - name: do a task
      bigip_facts:
          server: "my-big-ip.host.com"
          user: "admin"
          password: "mysecret"
          include: "interface,vlan"
      delegate_to: localhost
    

    I use this method on 11.6 boxes frequently.

  • Carter_Fields, see my response. You need to run this module locally.

     

  • A follow-up to this since we eventually got things sorted with Carter_Fields.

    Be sure to include

    gather_facts: false
    

    In your BIG-IP specific plays if you are on a BIG-IP release less than 12.x.

    Cheers!