devops-coop / ansible-haproxy

Installs and configure HAProxy
Apache License 2.0
96 stars 97 forks source link

AnsibleUndefinedVariable: 'macros' is undefined #90

Closed ghost closed 7 years ago

ghost commented 7 years ago

Maybe the commit https://github.com/devops-coop/ansible-haproxy/commit/106a0a54e72ddbd5e451c3ed6543e079c569dfa9 introduce a breaking change.

Short message is:

"msg": "AnsibleUndefinedVariable: 'macros' is undefined"

With all the details:

failed: [my_server] (item={u'http_request': [{u'action': u'add-header', u'param': u'X-Forwarded-Proto https', u'condition': u'if { ssl_fc }'}, {u'action': u'add-header', u'param': u'X-Forwarded-Ssl on', u'condition': u'if { ssl_fc }'}], u'description': u"Notre beau stock d'objets", u'name': u'bk_nexus', u'servers': [{u'ip': u'10.0.1.13', u'params': [u'check'], u'name': u'nexus1', u'port': u'8081'}, {u'ip': u'10.0.1.113', u'params': [u'check', u'backup'], u'name': u'nexus2', u'port': u'8081'}]}) => {"failed": true, "item": {"description": "Notre beau stock d'objets", "http_request": [{"action": "add-header", "condition": "if { ssl_fc }", "param": "X-Forwarded-Proto https"}, {"action": "add-header", "condition": "if { ssl_fc }", "param": "X-Forwarded-Ssl on"}], "name": "bk_nexus", "servers": [{"ip": "10.0.1.13", "name": "nexus1", "params": ["check"], "port": "8081"}, {"ip": "10.0.1.113", "name": "nexus2", "params": ["check", "backup"], "port": "8081"}]}, "msg": "AnsibleUndefinedVariable: 'macros' is undefined"}
ghost commented 7 years ago

I may be wrong but I think that the line below is message at the very top of same templates (especially backend.cfg):

{%- import '_macros.j2' as macros with context -%}