ansible-collections / community.zabbix

Zabbix Ansible modules
http://galaxy.ansible.com/community/zabbix
Other
315 stars 266 forks source link

Default value of zabbix_agent_include breaks userparameter task #1322

Closed Thulium-Drake closed 3 days ago

Thulium-Drake commented 4 days ago
SUMMARY

The default path used for zabbix_agent_include is /etc/zabbix/zabbix_agent2.d/*.conf (in the case of agent2), which is also used in https://github.com/ansible-collections/community.zabbix/blob/a7602eefb7074e90706d6543fc2cc4341889a4eb/roles/zabbix_agent/tasks/userparameter.yml#L32.

Which leads to the following error:

TASK [community.zabbix.zabbix_agent : Install user-defined userparameters] **************************************
failed: [virt1.zm1.element-networks.nl] (item={'name': 'zfs'}) => changed=false 
  ansible_loop_var: item
  checksum: d6c05c4b437828b38559acf1e50e8ac3e89098d8
  item:
    name: zfs
  msg: Destination directory /etc/zabbix/zabbix_agent2.d/*.conf does not exist

The issue is resolved when the zabbix_agent_include is set to /etc/zabbix/zabbix_agent2.d. This does not break the include logic of the Zabbix agent, it will still include all files in the configured directory.

ISSUE TYPE
COMPONENT NAME

zabbix_agent

ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT / Zabbix Version
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS