I've started a playbook that checks if a host is already in infoblox, and if not, it should add it. The checking is working fine, correctly giving an IP if its there, and nothing if it is not. The issue I am having is getting the next available ip.
- name: set host record if it isn't there
nios_host_record:
name: test-ansible.scsu.southernct.edu
ipv4addrs:
- ipv4addr:
"{{ lookup('nios_next_ip', '10.64.33.0/24',provider=nios_provider)[0] }}"
state: present
provider: "{{nios_provider}}"
The playbook error is this
fatal: [localhost]: FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'nios_next_ip'. Error was a <class 'infoblox_client.exceptions.InfobloxConnectionError'>, original message: Infoblox HTTP request failed with: 404 Client Error: Not Found for url: https://infoblox.XXXXX/wapi/v2.13.4/network?network=10.64.33.0%2F24&network_view=default&_max_results=1000&_proxy_search=GM. Infoblox HTTP request failed with: 404 Client Error: Not Found for url: https://infoblox.XXXXXX/wapi/v2.13.4/network?network=10.64.33.0%2F24&network_view=default&_max_results=1000&_proxy_search=GM"}
If I go directly to that URL and log in, I am greeted with this JSON
{ "Error": "AdmConDataNotFoundError: Network View default not found", "code": "Client.Ibap.Data.NotFound", "text": "Network View default not found"}
I am not sure if this is a problem with my ansible code, or a problem with Infoblox configuration at this point. Since the searching of infoblox is working, I don't suspect is a major ansible issue, but why doesn't that code work? It is basically the code from the ansible.com community documentation.
https://docs.ansible.com/ansible/8/scenario_guides/guide_infoblox.html
Thank you.