Created
September 12, 2017 00:50
-
-
Save johnsondnz/d015349e9ec8d7a06cd8a3455cfb0b9a to your computer and use it in GitHub Desktop.
Check it an ansible element is a dictionary, handy for defining an object with no iterables
This file contains hidden or 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 ansible import errors | |
from jinja2.filters import environmentfilter | |
class FilterModule(object): | |
def filters(self): | |
return { | |
'dict': self.dict | |
} | |
def dict(*args): | |
if isinstance(args[1], dict): | |
return True | |
else: | |
return False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment