# Ansible: Need to reset the value of variable before copy command.

**URL:** <https://forum.ansible.com/t/ansible-need-to-reset-the-value-of-variable-before-copy-command/24189>\
**Category:** Ansible Project\
**Created:** [April 11, 2017, 12:34pm UTC](https://forum.ansible.com/t/ansible-need-to-reset-the-value-of-variable-before-copy-command/24189 "2017-04-11T12:34:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nishant\_bawane](https://avatars.discourse-cdn.com/v4/letter/n/919ad9/32.png) [@nishant\_bawane](https://forum.ansible.com/u/nishant_bawane)\
**Post date:** [April 11, 2017, 12:34pm UTC](https://forum.ansible.com/t/ansible-need-to-reset-the-value-of-variable-before-copy-command/24189/1 "2017-04-11T12:34:17Z")

</div>

Query: I need to fetch the latest java version from host servers and display the same on web page, using apache server which is installed on my local server(local server means server with ansible installed).

I am able to fetch the value, but need to reset the value of one of the variable to blank , below are the details.

**I need to make it run time activity like —**

**when i have Both Hosts : zlp12036 and zlp12037, it must show the java version for both on my local server which has apache installed**  
**when i have Only one Host i.e.zlp12036, it must show the java version for zlp12036 only**  **on my local server which has apache installed.**

Host File Details -

[myserver]

zlp12036 ansible\_ssh\_host=[zlp12036.vci.att.com](http://zlp12036.vci.att.com) ansible\_ssh\_user=abc  
#zlp12037 ansible\_ssh\_host=[zlp12037.vci.att.com](http://zlp12037.vci.att.com) ansible\_ssh\_user=abc

Playbook:
