-
-
Save johnsondnz/69d18af1283aa71b4b4cf2ae830c769c to your computer and use it in GitHub Desktop.
Ansible filter plugin for testing if variables are a list
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 { | |
'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