ansible/ansible — pull request #4970 by bcoca (2013-11-19 19:53:15+00:00)
Title: more set filters

tested all types:

test.yml
```
---
- hosts: localhost
connection: local
gather_facts: True
vars:
cluster_interface: 'eth0'
list1: [1,2,3,4,5,6]
list2: [5,6,7,8,9,10]
list3: "{{list1 + list2}}"
tasks:
- debug: msg="{{list1|union(list2)}}"
- debug: msg="{{list3|unique}}"
- debug: msg="{{list1|intersect(list2)}}"
- debug: msg="{{list1|difference(list2)}}"
- debug: msg="{{list2|difference(list1)}}"
- debug: msg="{{list1|symmetric_difference(list2)}}"
```

output:
```

PLAY [localhost] **************************************************************

GATHERING FACTS ***************************************************************
ok: [localhost]

TASK: [debug msg="set([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])"] **********************
ok: [localhost] => {
"msg": "set([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])"
}

TASK: [debug msg="set([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])"] **********************
ok: [localhost] => {
"msg": "set([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])"
}

TASK: [debug msg="set([5, 6])"] ***********************************************
ok: [localhost] => {
"msg": "set([5, 6])"
}

TASK: [debug msg="set([1, 2, 3, 4])"] *****************************************
ok: [localhost] => {
"msg": "set([1, 2, 3, 4])"
}

TASK: [debug msg="set([7, 8, 9, 10])"] ****************************************
ok: [localhost] => {
"msg": "set([7, 8, 9, 10])"
}

TASK: [debug msg="set([1, 2, 3, 4, 7, 8, 9, 10])"] ****************************
ok: [localhost] => {
"msg": "set([1, 2, 3, 4, 7, 8, 9, 10])"
}

PLAY RECAP ********************************************************************

```