# Ansible read after write file in playbooks

**URL:** <https://forum.ansible.com/t/ansible-read-after-write-file-in-playbooks/17754>\
**Category:** Ansible Project\
**Created:** [March 16, 2015, 5:08pm UTC](https://forum.ansible.com/t/ansible-read-after-write-file-in-playbooks/17754 "2015-03-16T17:08:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahul\_Mehrotra](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@Rahul\_Mehrotra](https://forum.ansible.com/u/Rahul_Mehrotra)\
**Post date:** [March 16, 2015, 5:08pm UTC](https://forum.ansible.com/t/ansible-read-after-write-file-in-playbooks/17754/1 "2015-03-16T17:08:04Z")

</div>

Hi Everyone,  
I am working on a project using Ansible which requires me to write some data to a file using one playbook and then read the data from the same file using another playbook.

The playbook will be something like this

test1.yml

`

---

<div class="post-metadata">

**Author:** ![vaida.dan](https://avatars.discourse-cdn.com/v4/letter/v/5daacb/32.png) [@vaida.dan](https://forum.ansible.com/u/vaida.dan)\
**Post date:** [March 25, 2015, 12:02pm UTC](https://forum.ansible.com/t/ansible-read-after-write-file-in-playbooks/17754/2 "2015-03-25T12:02:07Z")

</div>

I’d register the data in a variable and use it during the playbook run. You can save it to a file during the playbook run as well.
