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

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.

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 }}”