# AWX: Solution for accessing jinja rendered files after job completion

**URL:** <https://forum.ansible.com/t/awx-solution-for-accessing-jinja-rendered-files-after-job-completion/2836>\
**Category:** Get Help\
**Tags:** awx, jinja2\
**Created:** [December 10, 2023, 5:33pm UTC](https://forum.ansible.com/t/awx-solution-for-accessing-jinja-rendered-files-after-job-completion/2836 "2023-12-10T17:33:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![crc31](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/crc31/32/1760_2.png) [@crc31](https://forum.ansible.com/u/crc31)\
**Post date:** [December 10, 2023, 5:33pm UTC](https://forum.ansible.com/t/awx-solution-for-accessing-jinja-rendered-files-after-job-completion/2836/1 "2023-12-10T17:33:19Z")

</div>

Hello everyone,

I’m rendering configuration files from Jinja templates in one of my playbooks and would like to access the resulting files in a different playbook run later.

Is this achievable?

I’ve looked for design suggestions on how to implement rendering files and using them in multi-stage playbook scenarios with AWX but haven’t found any.

Thanks for help!  
Alex

---

<div class="post-metadata">

**Author:** ![jpmens](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jpmens/32/5543_2.png) [@jpmens](https://forum.ansible.com/u/jpmens)\
**Post date:** [December 11, 2023, 7:34am UTC](https://forum.ansible.com/t/awx-solution-for-accessing-jinja-rendered-files-after-job-completion/2836/2 "2023-12-11T07:34:54Z")

</div>

Rendering with the [template lookup](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/template_lookup.html) might be a solution, or you might be able to `fetch` the files you templated out to a node and re-use them, though this seems “expensive”.

---

<div class="post-metadata">

**Author:** ![jbericat](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jbericat/32/627_2.png) [@jbericat](https://forum.ansible.com/u/jbericat)\
**Post date:** [December 11, 2023, 10:21am UTC](https://forum.ansible.com/t/awx-solution-for-accessing-jinja-rendered-files-after-job-completion/2836/3 "2023-12-11T10:21:21Z")

</div>

Hello @crc31 welcome to the community!

I haven’t tried it on AWX yet but I’ve done something similar with `ansible-navigator`: it may be possible to use a volume mount on kubernetes in the same way it is on docker.

> **[Configure a Pod to Use a Volume for Storage](https://kubernetes.io/docs/tasks/configure-pod-container/configure-volume-storage/)**
>
> This page shows how to configure a Pod to use a Volume for storage.
> A Container's file system lives only as long as the Container does. So when a Container terminates and restarts, filesystem changes are lost. For more consistent storage that is...

Then you can save your templated files there so they persist on the pod’s storage volume after the AWX job’s container deletion. This way yo could retrieve them later from another AWX Job, etc etc

Cheers

---

<div class="post-metadata">

**Author:** ![crc31](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/crc31/32/1760_2.png) [@crc31](https://forum.ansible.com/u/crc31)\
**Post date:** [December 11, 2023, 8:26pm UTC](https://forum.ansible.com/t/awx-solution-for-accessing-jinja-rendered-files-after-job-completion/2836/4 "2023-12-11T20:26:37Z")

</div>

Thank you both for these two excellent solutions!

I’ve implemented both ideas now and will definitely use both variations again based on future needs.

Lots of love  
Alex

---

<div class="post-metadata">

**Author:** ![jbericat](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jbericat/32/627_2.png) [@jbericat](https://forum.ansible.com/u/jbericat)\
**Post date:** [December 11, 2023, 8:49pm UTC](https://forum.ansible.com/t/awx-solution-for-accessing-jinja-rendered-files-after-job-completion/2836/5 "2023-12-11T20:49:51Z")

</div>

Hello Alex,

It’s nice to see we could help you with our suggestions!

May I ask you to tick the solved check on any of the answers provided? Since you implemented both successfully, I believe it doesn’t matter which one. Anyway, since @jpmens’s one came first, it’s only fair if you check his post as the “official” solution ☺ This way, this thread will appear as solved on the forum’s #Get Help category.

Thanks and see you around!

---

<div class="post-metadata">

**Author:** ![crc31](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/crc31/32/1760_2.png) [@crc31](https://forum.ansible.com/u/crc31)\
**Post date:** [December 11, 2023, 9:25pm UTC](https://forum.ansible.com/t/awx-solution-for-accessing-jinja-rendered-files-after-job-completion/2836/6 "2023-12-11T21:25:09Z")

</div>

I tried to tag both answers as “solutions,” but indeed that didn’t work.

If that happens again, I’ll express my gratitude in the future by sending you some good Westphalian craft beer. 🙂

---

<div class="post-metadata">

**Author:** ![jbericat](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jbericat/32/627_2.png) [@jbericat](https://forum.ansible.com/u/jbericat)\
**Post date:** [December 11, 2023, 10:11pm UTC](https://forum.ansible.com/t/awx-solution-for-accessing-jinja-rendered-files-after-job-completion/2836/7 "2023-12-11T22:11:49Z")

</div>

Hahaha no worries Alex, really! In fact this Westphalian craft beer you mention sounds great too 😉

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [January 10, 2024, 10:12pm UTC](https://forum.ansible.com/t/awx-solution-for-accessing-jinja-rendered-files-after-job-completion/2836/8 "2024-01-10T22:12:25Z")

</div>

Closed on January 10, 2024, 10:12pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
