diff --git a/lib/ansible/utils/template.py b/lib/ansible/utils/template.py index 42f5612a5b..311be63f5d 100644 --- a/lib/ansible/utils/template.py +++ b/lib/ansible/utils/template.py @@ -31,7 +31,7 @@ import pwd # TODO: refactor this file _LISTRE = re.compile(r"(\w+)\[(\d+)\]") - +JINJA2_OVERRIDE='#jinja2:' def _varFindLimitSpace(basedir, vars, space, part, depth): ''' limits the search space of space to part @@ -277,7 +277,7 @@ def template_from_file(basedir, path, vars): raise errors.AnsibleError("unable to read %s" % realpath) # Get jinja env overrides from template - if data.startswith('#env:'): + if data.startswith(JINJA2_OVERRIDE): eol = data.find('\n') line = data[5:eol] data = data[eol+1:] diff --git a/test/jinja2_overrides.tpl b/test/jinja2_overrides.tpl index 4d7a55c04a..b0e18238fa 100644 --- a/test/jinja2_overrides.tpl +++ b/test/jinja2_overrides.tpl @@ -1,4 +1,4 @@ -#env: variable_end_string: @@, variable_start_string: @@ +#jinja2: variable_end_string: @@, variable_start_string: @@ {% raw %} if this succeeds you should see '{{ ansible_hostname }}' with the hostname on the line above