From f629baef115bf798ad98ce6ed8f5003cb3c792d7 Mon Sep 17 00:00:00 2001 From: Bryan Larsen Date: Wed, 22 May 2013 14:06:18 -0400 Subject: [PATCH] add basename and dirname to the core jinja2 filters --- lib/ansible/runner/filter_plugins/core.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/ansible/runner/filter_plugins/core.py b/lib/ansible/runner/filter_plugins/core.py index b287068d8d..f1e26b0917 100644 --- a/lib/ansible/runner/filter_plugins/core.py +++ b/lib/ansible/runner/filter_plugins/core.py @@ -17,6 +17,7 @@ import base64 import json +import os.path import yaml def to_nice_yaml(*a, **kw): @@ -45,5 +46,9 @@ class FilterModule(object): 'to_yaml': yaml.safe_dump, 'to_nice_yaml': to_nice_yaml, 'from_yaml': yaml.safe_load, + + # path + 'basename': os.path.basename, + 'dirname': os.path.dirname, }