|
|
|
@ -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,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|