# Bazel definitions for Ansible roles, Molecule tests, etc

**URL:** <https://forum.ansible.com/t/bazel-definitions-for-ansible-roles-molecule-tests-etc/37726>\
**Category:** Ansible Project\
**Created:** [March 4, 2023, 12:05am UTC](https://forum.ansible.com/t/bazel-definitions-for-ansible-roles-molecule-tests-etc/37726 "2023-03-04T00:05:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![CB1](https://avatars.discourse-cdn.com/v4/letter/c/cdc98d/32.png) [@CB1](https://forum.ansible.com/u/CB1)\
**Post date:** [March 4, 2023, 12:05am UTC](https://forum.ansible.com/t/bazel-definitions-for-ansible-roles-molecule-tests-etc/37726/1 "2023-03-04T00:05:05Z")

</div>

Hi,

Has anyone written Bazel definitions for Ansible roles, Molecule tests, and such?

I would like within our Bazel framework to be able to run a molecule test by doing something along the lines of this:

bazel test //ansible:tests

And have it perform the Molecule tests for the pieces of our Ansible infrastructure that have changed since the last run.

Similarly, we could run a playbook using something like this:

bazel run //ansible/role:blah

Is this possible? Has anyone done this already? Should I be asking somewhere else?

Thanks for your help!

Corey
