ansible-collections / community.zabbix

Zabbix Ansible modules

Home Page:http://galaxy.ansible.com/community/zabbix

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Zabbix-agent - API calls. Host/Group vars are not loaded to the httpapi-connection plugin

kivilahtio opened this issue · comments

SUMMARY

When I define:

zabbix_api_server_host:
zabbix_api_server_port:
zabbix_api_login_user:
zabbix_api_use_ssl:
zabbix_api_login_pass:

In group vars or host vars they are not used in the roles/zabbix_agent/tasks/api.yml.
I have to explicitly set those variables in the role defaults -file

Other vars seem to work, such as

zabbix_agent_distribution_release:
ISSUE TYPE
  • Bug Report
COMPONENT NAME

Zabbix Agent

ANSIBLE VERSION
ansible [core 2.13.13]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/ansible/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.8/dist-packages/ansible
  ansible collection location = /home/ansible/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.8.10 (default, Nov 22 2023, 10:22:35) [GCC 9.4.0]
  jinja version = 3.1.4
  libyaml = True

CONFIGURATION
ANSIBLE_PIPELINING(/home/ansible/emb-toveri/Ansible/ansible.cfg) = True
COLLECTIONS_PATHS(/home/ansible/emb-toveri/Ansible/ansible.cfg) = ['/home/ansible/emb-toveri/Ansible']
DEFAULT_HOST_LIST(/home/ansible/emb-toveri/Ansible/ansible.cfg) = ['/home/ansible/ToveriConfig/inventory']
DEFAULT_REMOTE_USER(/home/ansible/emb-toveri/Ansible/ansible.cfg) = ansible
DEFAULT_STDOUT_CALLBACK(/home/ansible/emb-toveri/Ansible/ansible.cfg) = debug
DEFAULT_VAULT_PASSWORD_FILE(/home/ansible/emb-toveri/Ansible/ansible.cfg) = *************
INTERPRETER_PYTHON(/home/ansible/emb-toveri/Ansible/ansible.cfg) = /usr/bin/python3
OS / ENVIRONMENT / Zabbix Version

Ubuntu 20.04.6 LTS
Zabbix agent 6.4
Python3.8.10

STEPS TO REPRODUCE

Sorry for skimping out on this.

EXPECTED RESULTS
ACTUAL RESULTS

What version of the role are you using?

I cloned the source code and am using tag v2.4.0 (5bf4309)

Probably you are using wrong group/host vars files. These variables need to be defined for your Zabbix WebUI host.
Try using group_vars/all.yml or define the for the host defined in zabbix_api_server_host variable.