ansible/ansible — pull request #1777 by dominis (2012-12-14 12:29:00+00:00)
Title: fixes #1767 parsing serial from extra_vars

serial as a variable:

```
dominis@shuriken:~/work/ansible (devel=)$ cat /tmp/a.yml
---
- hosts: ${pool}
serial: ${servar}
port: ${port}
gather_facts: False
tasks:

- name: write a file
action: shell touch /tmp/foo

- name: delete it
action: shell rm -f /tmp/foo
```

```
dominis@shuriken:~/work/ansible (devel=)$ python bin/ansible-playbook /tmp/a.yml -e "servar=1 pool=app-pool port=2223"

PLAY [app-pool] *********************

TASK: [write a file] *********************
changed: [c.local]

TASK: [delete it] *********************
changed: [c.local]

TASK: [write a file] *********************
changed: [b.local]

TASK: [delete it] *********************
changed: [b.local]

TASK: [write a file] *********************
changed: [a.local]

TASK: [delete it] *********************
changed: [a.local]

PLAY RECAP *********************
a.local : ok=2 changed=2 unreachable=0 failed=0
b.local : ok=2 changed=2 unreachable=0 failed=0
c.local : ok=2 changed=2 unreachable=0 failed=0
```

serial defined in the yml still works fine:

```
dominis@shuriken:~/work/ansible (devel=)$ cat /tmp/a.yml
---
- hosts: ${pool}
serial: 2
port: ${port}
gather_facts: False
tasks:

- name: write a file
action: shell touch /tmp/foo

- name: delete it
action: shell rm -f /tmp/foo
```

```
dominis@shuriken:~/work/ansible (devel=)$ python bin/ansible-playbook /tmp/a.yml -e "pool=app-pool port=2223"

PLAY [app-pool] *********************

TASK: [write a file] *********************
changed: [c.local]
changed: [b.local]

TASK: [delete it] *********************
changed: [c.local]
changed: [b.local]

TASK: [write a file] *********************
changed: [a.local]

TASK: [delete it] *********************
changed: [a.local]

PLAY RECAP *********************
a.local : ok=2 changed=2 unreachable=0 failed=0
b.local : ok=2 changed=2 unreachable=0 failed=0
c.local : ok=2 changed=2 unreachable=0 failed=0
```