dj-wasabi / ansible-zabbix-agent

Installing and maintaining zabbix-agent for RedHat/Debian/Ubuntu/Windows/Suse.
https://galaxy.ansible.com/dj-wasabi/zabbix-agent
MIT License
327 stars 249 forks source link

fix check mode on Windows #305

Closed Poil closed 4 years ago

Poil commented 4 years ago

Description of PR

Fix this error when doing a dry-run

TASK [dj-wasabi.zabbix-agent : Windows | Setting Zabbix Service Recovery] *******************************************************************************************************************************************************************
fatal: [xxxxxxx]: FAILED! => {"msg": "The conditional check ''RESTART -- Delay' not in svc_recovery.stdout' failed. The error was: error while evaluating conditional ('RESTART -- Delay' not in svc_recovery.stdout): Unable to look up a name or access an attribute in template string ({% if 'RESTART -- Delay' not in svc_recovery.stdout %} True {% else %} False {% endif %}).\nMake sure your variable name does not contain invalid characters like '-': argument of type 'AnsibleUndefined' is not iterable\n\nThe error appears to be in '/home/poil/git/xxxxxxroles/dj-wasabi.zabbix-agent/tasks/Windows.yml': line 150, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: \"Windows | Setting Zabbix Service Recovery\"\n  ^ here\n"}

Type of change Bugfix Pull Request

dj-wasabi commented 4 years ago

Thanks! 👍