Infoblox - nios_host_record issue

Hi all,

I need to get IPs from an Infoblox server from an Ansible playbook. I am successfully obtaining the next IP address by using the nios_next_ip lookup within the correct IP range. I am then using the “nios_host_record” task to attempt to assign that IP in Infoblox. (Using Ansible 2.5.2)

`

  • name: Get next available IP
    set_fact:
    ipaddr: “{{ lookup(‘nios_next_ip’, IPAM_RANGE, provider={‘host’: ‘ipam.mydomain’, ‘username’: ‘tower’, ‘password’: ss2_result.TOWER_IPAM|quote }) }}”
    connection: local

  • debug: msg=“{{ipaddr[0]}}”

  • name: configure an ipv4 host record
    nios_host_record:
    name: aidantest.mydomain
    ipv4:

  • address: “{{ipaddr[0]}}”
    state: present
    provider:
    host: “ipam.mydomain”
    username: tower
    password: “{{ss2_result.TOWER_IPAM}}”
    connection: local

`

However, all I am getting back from the task is:

`
“Client.Obap.Data.Conflict”, “msg”: “The action is not allowed. A parent was not found.”, “operation”: “create_object”, “type”: “AdmConDataError”

`

The slight complication is that the Infobox is only used to hold a range of IPs and keep a record of what is allocated, it does not deal with DNS etc (that’s in Active Directory). I’m not sure if that has anything to do with the error, but thought best to mention it!

Has anyone got any ideas as to what I am doing wrong? I think I would have to specify the IP range in the nios_host_record call (like I do in the lookup) but I can’t see a way…?

Any assistance very much appreciated!

Aidan

OK,

Looks likes the way that InfoBlox as been setup and I need to add a “fixed address” rather than a host record.

Aidan