From 23cd7ad08ac3b0d34a099247f60c0496cee2ef01 Mon Sep 17 00:00:00 2001 From: Timothy Appnel Date: Thu, 6 Sep 2012 10:19:56 -0400 Subject: [PATCH] Added to_yaml and from_yaml filters to Jinja environment. --- lib/ansible/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/utils.py b/lib/ansible/utils.py index 9bf489a508a..7bef56da6e4 100644 --- a/lib/ansible/utils.py +++ b/lib/ansible/utils.py @@ -243,6 +243,8 @@ def template_from_file(basedir, path, vars): environment = jinja2.Environment(loader=jinja2.FileSystemLoader(basedir), trim_blocks=False) environment.filters['to_json'] = json.dumps environment.filters['from_json'] = json.loads + environment.filters['to_yaml'] = yaml.dump + environment.filters['from_yaml'] = yaml.load data = codecs.open(path_dwim(basedir, path), encoding="utf8").read() t = environment.from_string(data) vars = vars.copy()