# Invoke roles with different variables

**URL:** <https://forum.ansible.com/t/invoke-roles-with-different-variables/30109>\
**Category:** Ansible Project\
**Created:** [April 13, 2019, 4:41pm UTC](https://forum.ansible.com/t/invoke-roles-with-different-variables/30109 "2019-04-13T16:41:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Gateley](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@John\_Gateley](https://forum.ansible.com/u/John_Gateley)\
**Post date:** [April 13, 2019, 4:41pm UTC](https://forum.ansible.com/t/invoke-roles-with-different-variables/30109/1 "2019-04-13T16:41:52Z")

</div>

Hello,

I have a role “runit\_service” that creates a runit service based on variables (service\_name, script etc.)

I have two roles that depend on runit\_service: role\_a and role\_b. The intent is to create two runit\_services. The tail meta file for role\_a looks like:

```auto
dependencies:
  - role: runit_service
    vars:
**service_name** : role_a
script: /usr/bin/python3 /usr/local/bin/role_a

```

```auto
and the tail of the meta file for role_b is similar, except it has role_b in place of role_a

```

```auto
Finally my playbook is:

```
