-
Notifications
You must be signed in to change notification settings - Fork 63
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
INFOBLOX_HTTP_REQUEST_TIMEOUT cannot be an environmental variable #185
Comments
Hi @mrfito, Could you please share the yaml data from infoblox.yaml ? So that, I will test on my end to fix the issue. |
Hi @hemanthKa677 `# This file provides the configuration information for the Infoblox dynamic inventory script that is used to dynamically pull host information from NIOS.plugin: infoblox.nios_modules.nios_inventory hostfilter: |
* Fixed LBDN and Pool Object for transform fields [FIX] LBDN: auth_zone and pool field [FIX] POOL: servers and monitors field * Fixed BUGS for ENV Variables wapi_version and max_results BUG infobloxopen#198 BUG infobloxopen#185 * Resolve Issue infobloxopen#116 [ADD] Version to infoblox-client in requirement.txt
I am trying to use the inventory plugin connected to our infoblox device. I issue this command
$ ansible-inventory --list -i infoblox.yaml
and I expect to get a list of all the hosts in my infoblox device but I guess this instead
[WARNING]: * Failed to parse /home/infoblox.yaml with auto plugin: Infoblox HTTP request failed with: HTTPSConnectionPool(host='myhost.mydomain.com', port=443): Max retries exceeded with url: /wapi/v2.1/record%3Ahost?_return_fields=name%2Cview%2Cextattrs%2Cipv4addrs&_max_results=1000 (Caused by ReadTimeoutError("HTTPSConnectionPool(host='myhost.mydomain.com', port=443): Read timed out. (read timeout=10)",)) [WARNING]: * Failed to parse /home/infoblox.yaml with yaml plugin: Plugin configuration YAML file, not YAML inventory [WARNING]: * Failed to parse /home/infoblox.yaml with ini plugin: Invalid host pattern 'plugin:' supplied, ending in ':' is not allowed, this character is reserved to provide a port. [WARNING]: Unable to parse /home/infoblox.yaml as an inventory source [WARNING]: No inventory was parsed, only implicit localhost is available { "_meta": { "hostvars": {} }, "all": { "children": [ "ungrouped" ] } }
This error tells me that the infoblox device doesn't answer fast enough. Looking at the repo I find the file
plugins/module_utils/api.py
'http_request_timeout': dict(type='int', default=10, fallback=(env_fallback, ['INFOBLOX_HTTP_REQUEST_TIMEOUT'])),
So then I tried to set the environment variable
$ export INFOBLOX_HTTP_REQUEST_TIMEOUT=20
expecting to increase the timeout and then run
$ ansible-inventory --list -i infoblox.yaml
but instead of getting the list of hosts I get
[WARNING]: * Failed to parse /home/infoblox.yaml with auto plugin: Timeout value connect was 20, but it must be an int, float or None. [WARNING]: * Failed to parse /home/infoblox.yaml with yaml plugin: Plugin configuration YAML file, not YAML inventory [WARNING]: * Failed to parse /home/infoblox.yaml with ini plugin: Invalid host pattern 'plugin:' supplied, ending in ':' is not allowed, this character is reserved to provide a port. [WARNING]: Unable to parse /home/infoblox.yaml as an inventory source [WARNING]: No inventory was parsed, only implicit localhost is available { "_meta": { "hostvars": {} }, "all": { "children": [ "ungrouped" ] } }
It seems environmental variables are always strings so the inventory plugin should convert the env into a string. Am I wrong?
I know that my set up has all requirements and it is set up correctly because if I modified plugins/module_utils/api.py to have a timeout of 20
'http_request_timeout': dict(type='int', default=20, fallback=(env_fallback, ['INFOBLOX_HTTP_REQUEST_TIMEOUT'])),
and then I can successfully run
$ ansible-inventory --list -i infoblox.yaml
and I get the list of all hosts in our infoblox device.
In the meantime, is there a workaround that doesn't involve modifying apy.py?
The text was updated successfully, but these errors were encountered: