ansible-collections / community.zabbix

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

Conflicting defaults in zabbix_agent role #1383

Closed evilhamsterman closed 2 months ago

evilhamsterman commented 2 months ago
SUMMARY

If installing Agent2 the agent.conf.j2 file is set to default the StatusPort option to be commented out if the zabbix_agent_statusport value is not set https://github.com/ansible-collections/community.zabbix/blob/b5c237f135fc938ad7358c2d84723e34c1a0eba7/roles/zabbix_agent/templates/agent.conf.j2#L131.

However the value will always be set because the defaults file has the value set to 9999 https://github.com/ansible-collections/community.zabbix/blob/b5c237f135fc938ad7358c2d84723e34c1a0eba7/roles/zabbix_agent/defaults/main.yml#L36

The default config file included in the upstream packages does not set the StatusPort value and has no standard value, this leaves the potential that the port could be enabled or could conflict with other software unexpectedly

ISSUE TYPE
COMPONENT NAME

zabbix_agent role

ANSIBLE VERSION

NA

CONFIGURATION

NA

OS / ENVIRONMENT / Zabbix Version

All Zabbix versions and OS

STEPS TO REPRODUCE

Deploy the Zabbix Agent2 with the zabbix_agent role

EXPECTED RESULTS

StatusPort is commented out

ACTUAL RESULTS

The StatusPort value is set opening up the port unexpectedly

pyrodie18 commented 2 months ago

Read the discussion in https://github.com/ansible-collections/community.zabbix/pull/1376

evilhamsterman commented 3 weeks ago

@pyrodie18 I was thinking about this recently, I believe this issue should remain open and maybe be added to your next milestone. Regardless of whether you want to accept a breaking PR in the current release, which is understandable, it is still an issue with an unexpected behavior that exists. The fact there were two PRs within a short period of time addressing it shows that it is something people are running into. I assume most don't even know it's a thing and those of us who do find it annoying enough that we created PRs.