# How to use my jenkins variable in remote server  (defined from jenkins environment) use jenkins variable

**URL:** <https://forum.ansible.com/t/how-to-use-my-jenkins-variable-in-remote-server-defined-from-jenkins-environment-use-jenkins-variable/20944>\
**Category:** Ansible Project\
**Created:** [March 21, 2016, 12:24pm UTC](https://forum.ansible.com/t/how-to-use-my-jenkins-variable-in-remote-server-defined-from-jenkins-environment-use-jenkins-variable/20944 "2016-03-21T12:24:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pandithurai\_S](https://avatars.discourse-cdn.com/v4/letter/p/e0b2c6/32.png) [@Pandithurai\_S](https://forum.ansible.com/u/Pandithurai_S)\
**Post date:** [March 21, 2016, 12:24pm UTC](https://forum.ansible.com/t/how-to-use-my-jenkins-variable-in-remote-server-defined-from-jenkins-environment-use-jenkins-variable/20944/1 "2016-03-21T12:24:42Z")

</div>

How to use my jenkins variable( (defined from jenkins environment) in remote server using Ansible play book.

I am able to get my variable using

RPM\_URL\_PATH = is defined in jenkins environment variable

vars:  
URL: “{{ lookup(‘env’,‘RPM\_URL\_PATH’) }}”

I need to use value of RPM\_URL\_PATH in the shell script of my remote host.

i am running my shell script using shell module

shell: sh /opt/install\_script/test.sh

can you please help me on this ?

Thanks,  
Pandithurai.

---

<div class="post-metadata">

**Author:** ![Anderson\_Chad](https://avatars.discourse-cdn.com/v4/letter/a/13edae/32.png) [@Anderson\_Chad](https://forum.ansible.com/u/Anderson_Chad)\
**Post date:** [March 21, 2016, 1:47pm UTC](https://forum.ansible.com/t/how-to-use-my-jenkins-variable-in-remote-server-defined-from-jenkins-environment-use-jenkins-variable/20944/2 "2016-03-21T13:47:18Z")

</div>

You could pass the variable through SSH with SendEnv/AcceptEnv, but it would be much easier to modify your shell script to read in $1 then pass the URL variable like:

shell: sh /opt/install\_script/test.sh “{{ URL }}”
