Skip to content

Instantly share code, notes, and snippets.

@johnsondnz
Forked from udondan/iterable.py
Last active September 6, 2017 23:57
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/69d18af1283aa71b4b4cf2ae830c769c to your computer and use it in GitHub Desktop.
Save johnsondnz/69d18af1283aa71b4b4cf2ae830c769c to your computer and use it in GitHub Desktop.
Ansible filter plugin for testing if variables are a list
from ansible import errors
from jinja2.filters import environmentfilter
class FilterModule(object):
def filters(self):
return {
'iterable': self.iterable
}
def iterable(*args):
if isinstance(args[1], list):
return True
else:
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment