Forum Discussion
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
- tatmotiv
Cirrostratus
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?
- Tim_Rupp
Altostratus
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: localhostI use this method on 11.6 boxes frequently.
- Carter_Fields_2
Nimbostratus
I ran into the same issue. Anyone find a solution yet?
- Tim_Rupp
Altostratus
Carter_Fields, see my response. You need to run this module locally.
- Tim_Rupp
Altostratus
A follow-up to this since we eventually got things sorted with Carter_Fields.
Be sure to include
gather_facts: falseIn your BIG-IP specific plays if you are on a BIG-IP release less than 12.x.
Cheers!
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
