ansible/ansible — pull request #7398 by allardhoeve (2014-05-14 13:32:22+00:00)
Title: Add missing basedir to Runner in _do_setup_step

You can use a string template that does a pipe lookup in your vars yaml file like so:

```yaml
repo_version: "{{ lookup('pipe', 'git describe --tags') }}"
```

If you do so, the current working directory for that pipe command is currently not set correctly based on the path of the playbooks. It instead defaults to `os.getcwd()` [here](https://github.com/ansible/ansible/blob/release1.6.1/lib/ansible/runner/__init__.py#L161), because the `basedir` is not passed to the Runner instance in `_do_setup_step` [here](https://github.com/ansible/ansible/blob/release1.6.1/lib/ansible/playbook/__init__.py#L507).

1. To reproduce, use a variable in your vars.yaml, then call from outside your repository.
1. This bug never crops up if you call ansible from your repository root, but if you ever step outside of it, git will fail.

This PR has `_do_setup_step` pass its basedir to the runner. This makes things consistent with pipes in other places, that correctly set cwd.