# Loading role vars without executing role

**URL:** <https://forum.ansible.com/t/loading-role-vars-without-executing-role/36407>\
**Category:** AWX Project\
**Created:** [March 7, 2022, 10:04pm UTC](https://forum.ansible.com/t/loading-role-vars-without-executing-role/36407 "2022-03-07T22:04:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Manno](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/paul_manno/32/2804_2.png) [@Paul\_Manno](https://forum.ansible.com/u/Paul_Manno)\
**Post date:** [March 7, 2022, 10:04pm UTC](https://forum.ansible.com/t/loading-role-vars-without-executing-role/36407/1 "2022-03-07T22:04:03Z")

</div>

Hello,

A bit of background… I manage multiple applications. Each application has an ansible role defined for it. Sometimes, there is a playbook that is common to each application, but I would prefer to keep this playbook out of the ansible role and instead use the playbook from the parent project (to reduce code duplication); however, I do still need all the vars that are specific to the role in the playbook. Is there a way to load a role, but not have it execute at all? Just so I can reference the role variables? I tried including\_vars from roles/\<role\_name/defaults/main.yml but that does not seem to work. I did get it working by importing the role (my main.yml is a noop unless some flags are set) and that does work, but I’d prefer it if the role did not execute at all.

Thanks,  
Paul

---

<div class="post-metadata">

**Author:** ![Seth\_Foster](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@Seth\_Foster](https://forum.ansible.com/u/Seth_Foster)\
**Post date:** [March 9, 2022, 8:25pm UTC](https://forum.ansible.com/t/loading-role-vars-without-executing-role/36407/2 "2022-03-09T20:25:49Z")

</div>

Hi Paul,

This question seems best targeted for ansible-core, rather than awx. You may wish to reach out to those folks.

Here are some helpful links [https://docs.ansible.com/ansible/latest/community/communication.html](https://docs.ansible.com/ansible/latest/community/communication.html)

Seth

---

<div class="post-metadata">

**Author:** ![Paul\_Manno](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/paul_manno/32/2804_2.png) [@Paul\_Manno](https://forum.ansible.com/u/Paul_Manno)\
**Post date:** [March 9, 2022, 8:31pm UTC](https://forum.ansible.com/t/loading-role-vars-without-executing-role/36407/3 "2022-03-09T20:31:13Z")

</div>

Hi Seth,

Yep… I think you’re right. Thank you!

Best,  
Paul
