# Passing the var set in the 1st play to 2nd in the single playbook

**URL:** <https://forum.ansible.com/t/passing-the-var-set-in-the-1st-play-to-2nd-in-the-single-playbook/38229>\
**Category:** Ansible Project\
**Created:** [July 14, 2023, 9:53pm UTC](https://forum.ansible.com/t/passing-the-var-set-in-the-1st-play-to-2nd-in-the-single-playbook/38229 "2023-07-14T21:53:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raj\_Kumar](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@Raj\_Kumar](https://forum.ansible.com/u/Raj_Kumar)\
**Post date:** [July 14, 2023, 9:53pm UTC](https://forum.ansible.com/t/passing-the-var-set-in-the-1st-play-to-2nd-in-the-single-playbook/38229/1 "2023-07-14T21:53:25Z")

</div>

I am trying to set the var in the 1st play for same hosts and using the same in 2nd play in the same playbook for the same hosts but somehow the variable value is not getting passed to the 2nd play. How can i do this without defining the var again in the 2nd play

Thanks  
RK

---

<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:** [July 17, 2023, 1:50pm UTC](https://forum.ansible.com/t/passing-the-var-set-in-the-1st-play-to-2nd-in-the-single-playbook/38229/2 "2023-07-17T13:50:23Z")

</div>

how?
