Issue 1:
ISSUE TYPE

Bug Report

ANSIBLE VERSION

mjs10:ansible_test mspreitz$ ansible --version
ansible 2.1.0.0
config file =
configured module search path = Default w/o overrides

CONFIGURATION

No special configuration is involved.

OS / ENVIRONMENT

I have been testing in MacOS 10.10.5.

SUMMARY

If a playbook includes another playbook and then invokes a role, and the included playbook is from a different directory, then the role will not be sought in the right directories.

STEPS TO REPRODUCE

Use the attached zip archive, the quote below shows how.

ansible_test.zip

mjs10:Desktop mspreitz$ unzip ansible_test.zip
Archive: ansible_test.zip
creating: ansible_test/
inflating: ansible_test/.DS_Store
creating: ansible_test/foo/
inflating: ansible_test/foo/preplays.yml
creating: ansible_test/roles/
creating: ansible_test/roles/role1/
creating: ansible_test/roles/role1/tasks/
extracting: ansible_test/roles/role1/tasks/main.yml
inflating: ansible_test/site.yml
mjs10:Desktop mspreitz$ cd ansible_test
mjs10:ansible_test mspreitz$ ansible-playbook site.yml
ERROR! the role 'role1' was not found in /Users/mspreitz/Desktop/ansible_test/foo/roles:/Users/mspreitz/Desktop/ansible_test/foo:/etc/ansible/roles

The error appears to have been in '/Users/mspreitz/Desktop/ansible_test/site.yml': line 6, column 5, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

roles:
- role1
^ here

EXPECTED RESULTS

With 1.9, and the latest devel sources, it goes like this:

mjs10:ansible_test mspreitz$ ansible --version
ansible 2.2.0 (devel e04d552bc6) last updated 2016/06/28 15:57:48 (GMT -400)
lib/ansible/modules/core: (detached HEAD 3c6f2c2db1) last updated 2016/06/28 15:59:09 (GMT -400)
lib/ansible/modules/extras: (detached HEAD 1c36665545) last updated 2016/06/28 15:59:16 (GMT -400)
config file =
configured module search path = Default w/o overrides
mjs10:ansible_test mspreitz$
mjs10:ansible_test mspreitz$
mjs10:ansible_test mspreitz$ ansible-playbook site.yml

PLAY [localhost] ***************************************************************

TASK [setup] *******************************************************************
ok: [localhost]

TASK [debug] *******************************************************************
ok: [localhost] => {
"msg": "Preplay here"
}

PLAY [localhost] ***************************************************************

TASK [setup] *******************************************************************
ok: [localhost]

TASK [role1 : debug] ***********************************************************
ok: [localhost] => {
"msg": "role1 here"
}

PLAY RECAP *********************************************************************
localhost : ok=4 changed=0 unreachable=0 failed=0

ACTUAL RESULTS

mjs10:ansible_test mspreitz$ ansible-playbook -vvvv site.yml
No config file found; using defaults
ERROR! the role 'role1' was not found in /Users/mspreitz/Desktop/ansible_test/foo/roles:/Users/mspreitz/Desktop/ansible_test/foo:/etc/ansible/roles

The error appears to have been in '/Users/mspreitz/Desktop/ansible_test/site.yml': line 6, column 5, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

roles:
- role1
^ here

Issue 2:
ISSUE TYPE

Bug Report

ANSIBLE VERSION

ansible 2.1.0.0 (detached HEAD 036547b4dd) last updated 2016/05/19 15:27:19 (GMT -400)
lib/ansible/modules/core: (detached HEAD 297710c37e) last updated 2016/05/19 15:28:19 (GMT -400)
lib/ansible/modules/extras: (detached HEAD fa00795662) last updated 2016/05/19 15:28:19 (GMT -400)
config file =
configured module search path = Default w/o overrides

CONFIGURATION

OS / ENVIRONMENT

N/A

SUMMARY

playbook_dir is not getting reset across multiple - include: invocations

STEPS TO REPRODUCE

.
├── child
│ ├── child.yml
│ └── sibling.yml
├── parent1.yml
└── parent2.yml

# child.yml

---
- include: "{{ playbook_dir }}/sibling.yml"
- include: "{{ playbook_dir }}/../parent1.yml"
- include: "{{ playbook_dir }}/../parent2.yml"

ansible-playbook child.yml

EXPECTED RESULTS

For all playbooks to be successfully included and ran.

ACTUAL RESULTS

ERROR! the file_name '/Users/meyers/ansible/examples/bugs/parent2.yml' does not exist, or is not readable