ansible/ansible — pull request #163 by jhoekx (2012-04-18 09:48:21+00:00)
Title: Template the source file of the copy module.

In a playbook, given that this works:

```
---
- hosts: all
vars:
port: 5150
tasks:
- name: test basic shell, plus two ways to dereference a variable
action: shell echo $HOME $port {{ port }}
```

I expect this to work too:

```
---
- hosts: all
vars:
template: "../templates"
tasks:
- name: DNS configuration
action: copy src=$template/etc/resolv.conf dest=/etc/resolv.conf
```

It currently fails because we template the arguments after we try to copy the file.

This is a quick fix, but we really need to rethink/refactor our templating strategy. We template far too often. With this fix 14 times per copy play for two nodes!