xoanmi / ansible-module-infoblox

Awesome infobox module for ansible
GNU General Public License v3.0
38 stars 25 forks source link

No network/range found for specified parameters #37

Closed davisionz closed 7 years ago

davisionz commented 7 years ago

using the following YAML, i get "No network/range found for specified parameters trying to call from IPs in a certain range:

- name: request IP address from Infoblox
  infoblox:
    server: "{{ blox_master }}"
    username: "{{ blox_userid }}"
    password: "{{ blox_passwd }}"
    api_version: 2.7
    action: add_host
    net_view: default
    dns_view: Internal
    host: "{{ hostname }}.{{ domain }}"
    start_addr: "{{ start_addr }}"
    end_addr: "{{ end_addr }}"
   register: infoblox

OUTPUT:

1 plays in infoblox_add_entry.yml 5 6 PLAY [Get an IP address from infoblox] *16:11:39 7 META: ran handlers 8 9 TASK [request IP address from Infoblox] ****16:11:39 10 Using module file /var/lib/awx/projects/_8__ansible_provision/library/infoblox.py 11 <127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: awx 12 <127.0.0.1> EXEC /bin/sh -c 'echo ~ && sleep 0' 13 <127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /var/lib/awx/.ansible/tmp/ansible-tmp-1510265499.85-31244050963084" && echo ansible-tmp-1510265499.85-31244050963084="echo /var/lib/awx/.ansible/tmp/ansible-tmp-1510265499.85-31244050963084" ) && sleep 0' 14 <127.0.0.1> PUT /tmp/tmp5Ng2HU TO /var/lib/awx/.ansible/tmp/ansible-tmp-1510265499.85-31244050963084/infoblox.py 15 <127.0.0.1> EXEC /bin/sh -c 'chmod u+x /var/lib/awx/.ansible/tmp/ansible-tmp-1510265499.85-31244050963084/ /var/lib/awx/.ansible/tmp/ansible-tmp-1510265499.85-31244050963084/infoblox.py && sleep 0' 16 <127.0.0.1> EXEC /bin/sh -c '/usr/bin/python2 /var/lib/awx/.ansible/tmp/ansible-tmp-1510265499.85-31244050963084/infoblox.py; rm -rf "/var/lib/awx/.ansible/tmp/ansible-tmp-1510265499.85-31244050963084/" > /dev/null 2>&1 && sleep 0' 17 An exception occurred during task execution. To see the full traceback, use -vvv. The error was: Exception: No network/range found for specified parameters 18 fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "module_stderr": "Traceback (most recent call last):\n File \"/tmp/ansible_c9_YWs/ansible_module_infoblox.py\", line 2205, in \n main()\n File \"/tmp/ansible_c9_YWs/ansible_module_infoblox.py\", line 1921, in main\n raise Exception(\"No network/range found for specified parameters\")\nException: No network/range found for specified parameters\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 0} 19 20 PLAY RECAP *****16:11:40 21 localhost : ok=0 changed=0 unreachable=0 failed=1  22

davisionz commented 7 years ago

new infoblox user error... this was due to a lack of entries for range objects in Infoblox.

MogiePete commented 6 years ago

@davisionz

Can you explain what you did inside of Infoblox to enable this feature? I am getting the same error you are getting.

davisionz commented 6 years ago

In order to call from a range you have to create a range inside of the IP network first. Once created, you have to call that range explicitly in your ansible script. In infoblox, you can create dhcp ranges and reservation ranges.

MogiePete commented 6 years ago

@davisionz The non-DHCP reservation worked perfectly. Thank you for the quick reply.

davisionz commented 6 years ago

Good to hear. 👍