Loading role vars without executing role

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

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

Seth

Hi Seth,

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

Best,
Paul