ansible/ansible — pull request #1159 by dhozac (2012-09-30 12:06:14+00:00)
Title: Allow task includes to work with with_items

This will allow constructs such as:
### playbook.yml
```
---
- hosts: all
vars_files:
- vars/users.yml
tasks:
- include: tasks/user.yml user=$item
with_items: $users
```

### vars/users.yml
```
---
- username: timmy
gecos: Timmy
groups:
- group1
- group2
```

### tasks/user.yml
```
---
- name: create user ${user.username}
action: user name=${user.username} comment=${user.gecos}

- name: add user to groups
action: user name=${user.username} groups=$item append=yes
with_items: ${user.groups}
```

Among many others. Similarly for deploying the same codebase with a few different settings.