Hi,

Starting from version 0.5 of the Ansible Plugin the build environment 
variables are available during ansible execution. 
I'm currently trying to get the job workspace path inside my playbook 
(which I provide using job DSL) the following way:

---
- hosts: all
  tasks:
    - command: echo "$PATH"
      register: default_path
    - command: echo "$WORKSPACE"
      register: jenkins_job_workspace


However, WORKSPACE doesn't seem to be defined, as shown in the output:

TASK [command] 
***************************************************************** 
changed: [10.100.198.9] => {"changed": true, "cmd": ["echo", "$PATH"], "delta": 
"0:00:00.002428", "end": "2016-07-12 10:49:02.252685", "rc": 0, "start": 
"2016-07-12 10:49:02.250257", "stderr": "", "stdout": 
"/usr/local/bin:/usr/bin", "stdout_lines": ["/usr/local/bin:/usr/bin"], 
"warnings": []} 
TASK [command] 
***************************************************************** 
changed: [10.100.198.9] => {"changed": true, "cmd": ["echo", "$WORKSPACE"], 
"delta": "0:00:00.002479", "end": "2016-07-12 10:49:02.470880", "rc": 0, 
"start": "2016-07-12 10:49:02.468401", "stderr": "", "stdout": "$WORKSPACE", 
"stdout_lines": ["$WORKSPACE"], "warnings": []}

Is this the correct way to access them?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/871b0b23-0a8a-424a-b350-0cca5c451204%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to