If haproxy_global[frontends, backends, etc] aren't defined then 'when' portion won't catch this case before with_items tries to eval the var so you'll get:
TASK [ansible-haproxy : Build up the frontends] ********************************
fatal: [ifx-lb01]: FAILED! => {"failed": true, "msg": "'haproxy_frontends' is undefined"}
Even though the module is defined to avoid this. Providing a default empty array gets around this (and probably makes the 'when' unneeded).
If haproxy_global[frontends, backends, etc] aren't defined then 'when' portion won't catch this case before with_items tries to eval the var so you'll get:
Even though the module is defined to avoid this. Providing a default empty array gets around this (and probably makes the 'when' unneeded).