Skip to content

Instantly share code, notes, and snippets.

@shmileee
Last active April 16, 2022 23:47
Show Gist options
  • Save shmileee/c57cc05440331dcd3bcc9ccc81bdf1e8 to your computer and use it in GitHub Desktop.
Save shmileee/c57cc05440331dcd3bcc9ccc81bdf1e8 to your computer and use it in GitHub Desktop.
main.yml
def custom_filter(things):
equal = set()
for thing in things:
...
return ...
class FilterModule(object):
def filters(self):
return {'custom_filter': custom_filter}
---
- name: "Custom filter query"
set_fact:
results: "{{ api_response.json | custom_filter }}"
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment