Skip to content

Instantly share code, notes, and snippets.

@johnsondnz
Created September 12, 2017 00:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnsondnz/d015349e9ec8d7a06cd8a3455cfb0b9a to your computer and use it in GitHub Desktop.
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
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