voxpupuli / puppet-zabbix

Puppet module for creating and maintaining zabbix components with puppet.
https://forge.puppet.com/puppet/zabbix
Apache License 2.0
80 stars 228 forks source link

startup_script fails for windows #817

Closed logicminds closed 2 years ago

logicminds commented 2 years ago

This bug is caused due to a case sensitivity issue with the service name for windows. On windows the service name is capitalized while everything else it is lowercase. This causes the service to not start because the fail function is executed. A case insensitive comparison will fix this issue.

https://github.com/voxpupuli/puppet-zabbix/blob/master/manifests/startup.pp#L32

https://github.com/voxpupuli/puppet-zabbix/blob/master/manifests/params.pp#L103

What are you seeing

The catalog fails: we currently only support a title that contains agent or server

What behaviour did you expect instead

The catalog to complete sucessfully

Output log

Any additional information you'd like to impart

smortex commented 2 years ago

Puppet string comparison is not case sensitive, but repexp are. One can make them case insensitive but the syntax is not that readable, maybe better downcase the service name :wink: