Skip to content

Instantly share code, notes, and snippets.

@nerzhul
Created June 19, 2017 21:02
Show Gist options
  • Save nerzhul/ad2dc4c05d4b23132c64eb848a6be6d5 to your computer and use it in GitHub Desktop.
Save nerzhul/ad2dc4c05d4b23132c64eb848a6be6d5 to your computer and use it in GitHub Desktop.
ansible crc32 filter
# plugins/filter/crc32.py
import binascii
def crc32(s):
return binascii.crc32(s) & 0xffffffff
class FilterModule(object):
''' Ansible core jinja2 filters '''
def filters(self):
return {
'crc32': crc32,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment