Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in create host record. #269

Open
peterywong opened this issue Oct 16, 2024 · 2 comments
Open

Bug in create host record. #269

peterywong opened this issue Oct 16, 2024 · 2 comments

Comments

@peterywong
Copy link

I am having issues creating a host record, there seems to be a bug in the code.

Here's the AWX output:

module_stdout: ''

module_stderr: >

Failed on object search with url

https://infoblox.ucr.edu/wapi/v2.13/record%3Ahost?name=sys-peter-tl02.ads.ucr.edu&view=default&_return_fields=name%2Cview%2Cipv4addrs%2Cipv6addrs%2Cconfigure_for_dns%2Cuse_dns_ea_inheritance%2Caliases%2Cttl%2Cextattrs%2Ccomment%2Cipv4addrs.ipv4addr%2Cipv4addrs.mac%2Cipv4addrs.configure_for_dhcp%2Cipv4addrs.host%2Cipv4addrs.nextserver%2Cipv4addrs.use_nextserver%2Cipv4addrs.use_for_ea_inheritance%2Cipv6addrs.ipv6addr%2Cipv6addrs.duid%2Cipv6addrs.configure_for_dhcp%2Cipv6addrs.host%2Cipv6addrs.use_nextserver%2Cipv6addrs.nextserver&_max_results=1000:

b'{ "Error": "AdmConProtoError: Unknown argument/field:

'use_dns_ea_inheritance'", \n "code": "Client.Ibap.Proto", \n "text":

"Unknown argument/field: 'use_dns_ea_inheritance'"\n}'

Failed on object search with url

https://infoblox.ucr.edu/wapi/v2.13/record%3Ahost?name=sys-peter-tl02.ads.ucr.edu&view=default&_return_fields=name%2Cview%2Cipv4addrs%2Cipv6addrs%2Cconfigure_for_dns%2Cuse_dns_ea_inheritance%2Caliases%2Cttl%2Cextattrs%2Ccomment%2Cipv4addrs.ipv4addr%2Cipv4addrs.mac%2Cipv4addrs.configure_for_dhcp%2Cipv4addrs.host%2Cipv4addrs.nextserver%2Cipv4addrs.use_nextserver%2Cipv4addrs.use_for_ea_inheritance%2Cipv6addrs.ipv6addr%2Cipv6addrs.duid%2Cipv6addrs.configure_for_dhcp%2Cipv6addrs.host%2Cipv6addrs.use_nextserver%2Cipv6addrs.nextserver&_max_results=1000&_proxy_search=GM:

b'{ "Error": "AdmConProtoError: Unknown argument/field:

'use_dns_ea_inheritance'", \n "code": "Client.Ibap.Proto", \n "text":

"Unknown argument/field: 'use_dns_ea_inheritance'"\n}'

Traceback (most recent call last):

File "/usr/local/lib/python3.12/site-packages/infoblox_client/connector.py", line 317, in get_object

return self._handle_get_object(obj_type, query_params, extattrs,

   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.12/site-packages/infoblox_client/connector.py", line 354, in _handle_get_object

return self._get_object(obj_type, url)

   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.12/site-packages/infoblox_client/connector.py", line 370, in _get_object

r.raise_for_status()

File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 1024, in raise_for_status

raise HTTPError(http_error_msg, response=self)

requests.exceptions.HTTPError: 400 Client Error: Bad Request for url:

https://infoblox.ucr.edu/wapi/v2.13/record%3Ahost?name=sys-peter-tl02.ads.ucr.edu&view=default&_return_fields=name%2Cview%2Cipv4addrs%2Cipv6addrs%2Cconfigure_for_dns%2Cuse_dns_ea_inheritance%2Caliases%2Cttl%2Cextattrs%2Ccomment%2Cipv4addrs.ipv4addr%2Cipv4addrs.mac%2Cipv4addrs.configure_for_dhcp%2Cipv4addrs.host%2Cipv4addrs.nextserver%2Cipv4addrs.use_nextserver%2Cipv4addrs.use_for_ea_inheritance%2Cipv6addrs.ipv6addr%2Cipv6addrs.duid%2Cipv6addrs.configure_for_dhcp%2Cipv6addrs.host%2Cipv6addrs.use_nextserver%2Cipv6addrs.nextserver&_max_results=1000

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/usr/local/lib/python3.12/site-packages/infoblox_client/connector.py", line 53, in callee

return func(*args, **kwargs)

   ^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.12/site-packages/infoblox_client/connector.py", line 321, in get_object

return self._handle_get_object(obj_type, query_params,

   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.12/site-packages/infoblox_client/connector.py", line 354, in _handle_get_object

return self._get_object(obj_type, url)

   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/usr/local/lib/python3.12/site-packages/infoblox_client/connector.py", line 370, in _get_object

r.raise_for_status()

File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 1024, in raise_for_status

raise HTTPError(http_error_msg, response=self)

requests.exceptions.HTTPError: 400 Client Error: Bad Request for url:

https://infoblox.ucr.edu/wapi/v2.13/record%3Ahost?name=sys-peter-tl02.ads.ucr.edu&view=default&_return_fields=name%2Cview%2Cipv4addrs%2Cipv6addrs%2Cconfigure_for_dns%2Cuse_dns_ea_inheritance%2Caliases%2Cttl%2Cextattrs%2Ccomment%2Cipv4addrs.ipv4addr%2Cipv4addrs.mac%2Cipv4addrs.configure_for_dhcp%2Cipv4addrs.host%2Cipv4addrs.nextserver%2Cipv4addrs.use_nextserver%2Cipv4addrs.use_for_ea_inheritance%2Cipv6addrs.ipv6addr%2Cipv6addrs.duid%2Cipv6addrs.configure_for_dhcp%2Cipv6addrs.host%2Cipv6addrs.use_nextserver%2Cipv6addrs.nextserver&_max_results=1000&_proxy_search=GM

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/runner/.ansible/tmp/ansible-tmp-1728599441.9598792-90-7906081536893/AnsiballZ_nios_host_record.py", line 107, in

_ansiballz_main()

File "/runner/.ansible/tmp/ansible-tmp-1728599441.9598792-90-7906081536893/AnsiballZ_nios_host_record.py", line 99, in _ansiballz_main

invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)

File "/runner/.ansible/tmp/ansible-tmp-1728599441.9598792-90-7906081536893/AnsiballZ_nios_host_record.py", line 47, in invoke_module

runpy.run_module(mod_name='ansible_collections.infoblox.nios_modules.plugins.modules.nios_host_record', init_globals=dict(_module_fqn='ansible_collections.infoblox.nios_modules.plugins.modules.nios_host_record', _modlib_path=modlib_path),

File "", line 226, in run_module

File "", line 98, in _run_module_code

File "", line 88, in _run_code

File "/tmp/ansible_infoblox.nios_modules.nios_host_record_payload_4_fdqib7/ansible_infoblox.nios_modules.nios_host_record_payload.zip/ansible_collections/infoblox/nios_modules/plugins/modules/nios_host_record.py", line 456, in

File "/tmp/ansible_infoblox.nios_modules.nios_host_record_payload_4_fdqib7/ansible_infoblox.nios_modules.nios_host_record_payload.zip/ansible_collections/infoblox/nios_modules/plugins/modules/nios_host_record.py", line 450, in main

File "/tmp/ansible_infoblox.nios_modules.nios_host_record_payload_4_fdqib7/ansible_infoblox.nios_modules.nios_host_record_payload.zip/ansible_collections/infoblox/nios_modules/plugins/module_utils/api.py", line 331, in run

File "/tmp/ansible_infoblox.nios_modules.nios_host_record_payload_4_fdqib7/ansible_infoblox.nios_modules.nios_host_record_payload.zip/ansible_collections/infoblox/nios_modules/plugins/module_utils/api.py", line 872, in get_object_ref

File "/tmp/ansible_infoblox.nios_modules.nios_host_record_payload_4_fdqib7/ansible_infoblox.nios_modules.nios_host_record_payload.zip/ansible_collections/infoblox/nios_modules/plugins/module_utils/api.py", line 260, in _invoke_method

File "/usr/local/lib/python3.12/site-packages/infoblox_client/connector.py", line 57, in callee

raise ib_ex.InfobloxConnectionError(reason=e)

infoblox_client.exceptions.InfobloxConnectionError: Infoblox HTTP request

failed with: 400 Client Error: Bad Request for url:

https://infoblox.ucr.edu/wapi/v2.13/record%3Ahost?name=sys-peter-tl02.ads.ucr.edu&view=default&_return_fields=name%2Cview%2Cipv4addrs%2Cipv6addrs%2Cconfigure_for_dns%2Cuse_dns_ea_inheritance%2Caliases%2Cttl%2Cextattrs%2Ccomment%2Cipv4addrs.ipv4addr%2Cipv4addrs.mac%2Cipv4addrs.configure_for_dhcp%2Cipv4addrs.host%2Cipv4addrs.nextserver%2Cipv4addrs.use_nextserver%2Cipv4addrs.use_for_ea_inheritance%2Cipv6addrs.ipv6addr%2Cipv6addrs.duid%2Cipv6addrs.configure_for_dhcp%2Cipv6addrs.host%2Cipv6addrs.use_nextserver%2Cipv6addrs.nextserver&_max_results=1000&_proxy_search=GM

msg: |-

MODULE FAILURE

See stdout/stderr for the exact error

rc: 1

_ansible_no_log: false

changed: false

@peterywong
Copy link
Author

Seems to be a bug in NIOS 9.0.0 that is fixed in 9.0.4.

@mkearey
Copy link

mkearey commented Dec 4, 2024

G'day Peter. According to my reading:

"use_dns_ea_inheritance
When use_dns_ea_inheritance is True, the EA is inherited from associated zone.

Type

Bool.

Create

The default value is False.

Search

The field is not available for search." <---- this.

The ansible module is adding the field as a search term :

""module_stderr": "Failed on object search with url https://infoblox.blah.blah/wapi/v2.11/record%3Ahost?name=eg.example.com&view=default&_return_fields=name%2Cview%2Cipv4addrs%2Cipv6addrs%2Cconfigure_for_dns%2Cuse_dns_ea_inheritance..., "

use_dns_ea_inheritance field was never available to search on where as this update to ansible nios modules attempts to use it when creating a host object. I feel this is a bug in the nios module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants