Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Added to_json filter to Jinja2 environment when run through template_from_file #980

wants to merge 1 commit into from

2 participants

Timothy Appnel Michael DeHaan
Timothy Appnel

This is a follow-up to #956.

Michael DeHaan

jp_mens fixed the previous applied patch last night, should be good to go if you revert this commit and pull again.


Michael DeHaan mpdehaan closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 31, 2012
  1. Timothy Appnel
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 0 deletions.
  1. +1 −0  lib/ansible/
1  lib/ansible/
@@ -211,6 +211,7 @@ def template_from_file(basedir, path, vars):
''' run a file through the templating engine '''
environment = jinja2.Environment(loader=jinja2.FileSystemLoader(basedir), trim_blocks=False)
+ environment.filters['to_json'] = json.dumps
data =, path), encoding="utf8").read()
t = environment.from_string(data)
vars = vars.copy()
Something went wrong with that request. Please try again.