Skip to content

Instantly share code, notes, and snippets.

@aderixon
Last active November 12, 2021 10:27
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 aderixon/f5183bef178e64650788ac2e8dc618e5 to your computer and use it in GitHub Desktop.
Save aderixon/f5183bef178e64650788ac2e8dc618e5 to your computer and use it in GitHub Desktop.
Ansible Jinja2 2.7 equalto test
# backported Jinja2 'equalto' test, from 2.10
# required for EL7
# place in test_plugins/ folder within your playbook or role directory:
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import operator
class TestModule:
''' Ansible backported equalto jinja2 test '''
def tests(self):
return {
'equalto': operator.eq,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment