Created
December 19, 2015 03:46
-
-
Save juliedavila/0949d513b10e540e6a36 to your computer and use it in GitHub Desktop.
Ansible Filter plugin for ansible <2.0 that reverses a string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from jinja2 import contextfilter | |
class FilterModule(object): | |
''' Extra filters ''' | |
def filters(self): | |
return { | |
'reverse': self.reverse_string, | |
} | |
def reverse_string(self, firstarg): | |
return firstarg[::-1] | |
~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment