diff --git a/lib/ansible/runner/filter_plugins/core.py b/lib/ansible/runner/filter_plugins/core.py index b86abae42a6..495e17e2fa0 100644 --- a/lib/ansible/runner/filter_plugins/core.py +++ b/lib/ansible/runner/filter_plugins/core.py @@ -126,6 +126,15 @@ def unique(a): def intersect(a, b): return set(a).intersection(b) +def difference(a, b): + return set(a).difference(b) + +def symmetric_difference(a, b): + return set(a).symmetric_difference(b) + +def union(a, b): + return set(a).union(b) + class FilterModule(object): ''' Ansible core jinja2 filters ''' @@ -183,5 +192,8 @@ class FilterModule(object): # list 'unique' : unique, 'intersect': intersect, + 'difference': difference, + 'symmetric_difference': symmetric_difference, + 'union': union, } - +