Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jinja2 variable_start_string cannot be set #10031

Closed
droe opened this issue Jan 17, 2015 · 5 comments
Closed

jinja2 variable_start_string cannot be set #10031

droe opened this issue Jan 17, 2015 · 5 comments
Labels
feature This issue/PR relates to a feature request.

Comments

@droe
Copy link

droe commented Jan 17, 2015

Issue Type:

Bug Report

Ansible Version:

At least >= 1.7, including latest devel branch

Environment:

N/A

Summary:

Ansible cannot template config files that need to preserve {{ syntax (e.g. exim config), and there seems to be no workaround preserving the ability to template such files. Earlier versions had the ability to specify variable_start_string in the template, but that was removed without providing any alternative (cf. unresolved but closed #9491, #8347, #8101, #8040).

It would be great to leave at least one of the issue tickets pertaining to this problem open until an actual fix is committed, so people who are burnt by the inability of ansible templating such files have a ticket to see the current state.

Steps To Reproduce:

Take e.g. your typical production exim main configuration file containing copious amounts of {{ and }} and try to deploy it using the template module. Add #jinja2: variable_start_string: "[%", variable_end_string: "%]" at the start of the templated exim config.

Expected Results:

Ansible should use [% for variable expansion and leave the {{ exim syntax alone, while preserving the ability to use jinja2 features in the template.

Actual Results:
fatal: [example.net] => {'msg': "AnsibleError: file: .../templates/configure.j2, line number: 683, error: expected token 'end of print statement', got '{'", 'failed': True}
@bcoca bcoca added P4 labels Jan 19, 2015
@sbocahu
Copy link
Contributor

sbocahu commented Mar 30, 2015

+1 !

@AlekSi
Copy link

AlekSi commented Sep 5, 2015

+1

@bcoca
Copy link
Member

bcoca commented Sep 6, 2015

works in current devel

@bcoca bcoca closed this as completed Sep 6, 2015
@bcoca
Copy link
Member

bcoca commented Sep 6, 2015

Closing This Ticket

Hi!

We believe recent commits (likely detailed above) should resolve this question or problem for you.

This will also be included in the next major release.

If you continue seeing any problems related to this issue, or if you have any further questions, please let us know by stopping by one of the two mailing lists, as appropriate:

Because this project is very active, we're unlikely to see comments made on closed tickets, but the mailing list is a great way to ask questions, or post if you don't think this particular
issue is resolved.

Thank you!

@bjne
Copy link
Contributor

bjne commented Sep 28, 2015

You could atleast point to a commit if you think this is solved. Unprofessional to just close
the issue!

@ansibot ansibot added feature This issue/PR relates to a feature request. and removed feature_idea labels Mar 2, 2018
@ansible ansible locked and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature This issue/PR relates to a feature request.
Projects
None yet
Development

No branches or pull requests

6 participants