# include\_role variables scoping issue

**URL:** <https://forum.ansible.com/t/include-role-variables-scoping-issue/24370>\
**Category:** Ansible Developer\
**Created:** [May 2, 2017, 7:23am UTC](https://forum.ansible.com/t/include-role-variables-scoping-issue/24370 "2017-05-02T07:23:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Enrico\_Stahn](https://avatars.discourse-cdn.com/v4/letter/e/aca169/32.png) [@Enrico\_Stahn](https://forum.ansible.com/u/Enrico_Stahn)\
**Post date:** [May 2, 2017, 7:23am UTC](https://forum.ansible.com/t/include-role-variables-scoping-issue/24370/1 "2017-05-02T07:23:39Z")

</div>

Hi there,

It appears the variables that are passed to a role from a play can’t be overridden in include\_role. Does anyone have this issue?

Example:

```auto
---
- name: test
  hosts: localhost
  connection: local
  gather_facts: false

  roles:
    - { role: roleA, name: 'testname1' }

```

```auto

```

In roleA the task is doing:

```auto
- name: test
  include_role:
    name: roleB
    tasks_from: foobar123
  vars:
    name: testname2

```

```auto

```

In this case the value in roleB-\>foobar123-\>name will be **testname1** while it should be **testname2**.
