You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using community.zabbix.zabbix_inventory you have to create a zabbix_inventory.yml
In zabbix_inventory.yml, you should be able to only provide auth_token without requiring login_user and login_password to be set.
Currently, regardless if the auth_token is set, the login_user and login_password are required. Otherwise, inventory collection will fail to produce results. If you provide dummy values for login_user and login_password values then this will work.
When only auth_token is provided and login_user and login_password are omitted then the inventory plugin should work and provide the same results as if login_user and login_password were provided instead of failing.
ACTUAL RESULTS
Does not work when using only auth_token in zabbix_inventory.yml file. Even when using auth_token, you must provide a dummy login_user and login_password value to prevent this error.
(myenv) ➜ /workdir ansible-inventory --list all -i zabbix_inventory.yml
[WARNING]: * Failed to parse /workdir/zabbix_inventory.yml with auto plugin: No setting was provided for required configuration plugin_type: inventory plugin:
ansible_collections.community.zabbix.plugins.inventory.zabbix_inventory setting: login_user
[WARNING]: * Failed to parse /workdir/zabbix_inventory.yml with yaml plugin: Plugin configuration YAML file, not YAML inventory
[WARNING]: * Failed to parse /workdir/zabbix_inventory.yml 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 /workdir/zabbix_inventory.yml as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
{
"_meta": {
"hostvars": {}
},
"all": {
"children": [
"ungrouped"
]
}
}
The text was updated successfully, but these errors were encountered:
SUMMARY
When using
community.zabbix.zabbix_inventory
you have to create azabbix_inventory.yml
In
zabbix_inventory.yml
, you should be able to only provideauth_token
without requiringlogin_user
andlogin_password
to be set.Currently, regardless if the
auth_token
is set, thelogin_user
andlogin_password
are required. Otherwise, inventory collection will fail to produce results. If you provide dummy values forlogin_user
andlogin_password
values then this will work.ISSUE TYPE
COMPONENT NAME
community.zabbix.zabbix_inventory
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT / Zabbix Version
Target zabbix server is from the docker-compose.yml in the project dir
Version: 6.0
STEPS TO REPRODUCE
Create the
zabbix_inventory.yml
file with the contents listed below. Onlyauth_token
is set andlogin_user
andlogin_password
are commented out.Note: Below I am using an env var
ZABBIX_API_KEY
but it is the same issue if you add the API key in clear text as well.EXPECTED RESULTS
When only
auth_token
is provided andlogin_user
andlogin_password
are omitted then the inventory plugin should work and provide the same results as iflogin_user
andlogin_password
were provided instead of failing.ACTUAL RESULTS
Does not work when using only auth_token in zabbix_inventory.yml file. Even when using auth_token, you must provide a dummy login_user and login_password value to prevent this error.
The text was updated successfully, but these errors were encountered: