# AWX shared playbook between projects/templates?

**URL:** <https://forum.ansible.com/t/awx-shared-playbook-between-projects-templates/40233>\
**Category:** Get Help\
**Tags:** template, awx\
**Created:** [February 12, 2025, 9:15pm UTC](https://forum.ansible.com/t/awx-shared-playbook-between-projects-templates/40233 "2025-02-12T21:15:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dpowell](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dpowell](https://forum.ansible.com/u/dpowell)\
**Post date:** [February 12, 2025, 9:15pm UTC](https://forum.ansible.com/t/awx-shared-playbook-between-projects-templates/40233/1 "2025-02-12T21:15:03Z")

</div>

Is it possible to share a playbook between projects? I’m able to share roles by creating a symlink but it doesn’t appear to work with playbooks. I have a playbook that basically includes a role which works between projects but I have to create basically a duplicate playbook in each scm repo so I can create a template using the playbook for each repo when its the exact same playbook.

---

<div class="post-metadata">

**Author:** ![dpowell](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dpowell](https://forum.ansible.com/u/dpowell)\
**Post date:** [February 12, 2025, 9:16pm UTC](https://forum.ansible.com/t/awx-shared-playbook-between-projects-templates/40233/2 "2025-02-12T21:16:11Z")

</div>

The symlink works allowing me to create the template but when I actually run the template it fails saying it can’t find `playbooks/shared_playbook.yml`

---

<div class="post-metadata">

**Author:** ![iwt-cmd](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/iwt-cmd/32/9120_2.png) [@iwt-cmd](https://forum.ansible.com/u/iwt-cmd)\
**Post date:** [February 14, 2025, 12:11pm UTC](https://forum.ansible.com/t/awx-shared-playbook-between-projects-templates/40233/3 "2025-02-14T12:11:54Z")

</div>

Hi dpowell,

I’m not sure if that’s possible but, if it is, it sounds like a “it works but unsupported” solution. I could see running into maintainability issues managing links between projects/repos, depending on how much you’re planning to scale.

One option is to keep the single repo/project but wrap the template in question in a workflow. This would allow you to present the playbook to multiple orgs (if you’re using those for RBAC) and/or with different names while only having to maintain a single repo. The workflow can belong to a different org from the template as long as the user building the workflow has access to both orgs. The user running the workflow just needs access to the workflow, not necessarily the template(s).

We use a similar approach to allow for template reuse between multiple use cases where we only need to change a variable, survey question or inventory but the main playbook code is the same. This also allows us to abstract the playbook logic from contractors who just need to execute the tool but shouldn’t have access to the underlying templates.

Happy to help brainstorm ideas

---

<div class="post-metadata">

**Author:** ![dpowell](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dpowell](https://forum.ansible.com/u/dpowell)\
**Post date:** [February 14, 2025, 4:19pm UTC](https://forum.ansible.com/t/awx-shared-playbook-between-projects-templates/40233/4 "2025-02-14T16:19:03Z")

</div>

Thanks for the info. I’m testing one more thing right now so will see if it helps. Then will explore the workflow template ideal. I’ve only played with them for a few mins. We’re currently switching from a home grown ansible UI to AWX. We’re just trying to make sure we have as much of a seamless transition for our consumers on our tool to AWX.

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [February 14, 2025, 6:30pm UTC](https://forum.ansible.com/t/awx-shared-playbook-between-projects-templates/40233/5 "2025-02-14T18:30:58Z")

</div>

When AWX runs a playbook, it creates a new container and copies the project to the container. Then that container runs the playbook, and will have all of the resources available within that project.

By creating a symlink in your project to _another_ project, the job container ends up with a symlink that points to nothing because the other project doesn’t get copied over.

So no, sharing a playbook between projects isn’t “supported” like this. However, you _can_ place a playbook inside of a collection, and have AWX dynamically install the collection via a requirements file in each project. However, to run that playbook, you would need to have a playbook in each project that uses the `import_playbook` keyword to call the playbook in the collection.

---

<div class="post-metadata">

**Author:** ![dpowell](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dpowell](https://forum.ansible.com/u/dpowell)\
**Post date:** [February 14, 2025, 6:44pm UTC](https://forum.ansible.com/t/awx-shared-playbook-between-projects-templates/40233/6 "2025-02-14T18:44:48Z")

</div>

Thanks, that is what I was testing. I tried setting `Follow symlinks` in the Job-Settings but that didn’t work. It allows me to choose the `playbooks/playbook.yml` since its found but as you stated it wasn’t copied into the container as it was a link.

I think the simple playbook to include the collections playbook may be the simplest thing to try at this point.
