Ansible Network Automation video - describes how to create custom jinja2 filters using python code in the filter_plugins directory. Includes a simple example and a more advanced example using TTP to generate structured QoS data.
playbooks and plugins on github fp-video branch - https://github.com/he-pings/ansible_net_auto/tree/fp-video