Hi everyone,
I'm trying to put a string by replacing a macro in a template but the problem is that the string itself it's being interpreted as a macro and I need to avoida that. Here are config vars and the template:
vars.yml:
log_format: "[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s"
expire: 1000
template (setting.py):
formatter = logging.Formatter("{{ api_log_format }}")
expire = {{expire}}
When I execute the playbook I'm getting the following error:
{'msg': 'AnsibleError: ERROR! Failed to template [%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s: ERROR! template error while templating string: tag name expected', 'failed': True}
If I change {%(pathname)s:%(lineno)d} with for example [%(pathname)s:%(lineno)d] the problem it's solved and the playbook continues but I can't do that because it's a developers request that the { and } exists in the log format.
Is there any way that I could tell ansible to ignore that specific line?
Any other idea?
I'm using ansible v1.9.2
Thanks!