ansible/ansible — pull request #5724 by angstwad (2014-01-22 17:08:48+00:00)
Title: Fix bug where playbook tasks do not escalate privs with 'su'

Hey guys, caught my own bug here in my recently merged su support.

This was causing a problem were su was being set at the task level and not the play level in playbooks, causing su-marked tasks to never escalate privs. This will fix the problem.

Use this play before and after to confirm:
```
---
- name: Test
hosts: etcd
gather_facts: no
tasks:
- name: "No sudo or su"
command: /usr/bin/whoami

- name: "su to root"
command: /usr/bin/whoami
su: yes

- name: "su to testuser"
command: /usr/bin/whoami
su: yes
su_user: testuser
su_pass: notMyREALpassword

- name: "sudo to root"
command: /usr/bin/whoami
sudo: yes
sudo_pass: notMyREALpassword
```

Tests are passing:
```
Ran 96 tests in 27.259s

OK (SKIP=1)
```