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

60 views
Skip to first unread message

Pandithurai S

unread,
Mar 21, 2016, 9:24:32 AM3/21/16
to Ansible Project
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.

Anderson, Chad

unread,
Mar 21, 2016, 9:53:12 AM3/21/16
to ansible...@googlegroups.com
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 }}"

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/d78071bd-fd3a-441f-b945-e71af147a18a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Chad Anderson
DevOps Engineer
DomainTools

Reply all
Reply to author
Forward
0 new messages