job.execid context variable and reference job step

246 views
Skip to first unread message

robert...@gmail.com

unread,
Apr 17, 2014, 11:29:39 AM4/17/14
to rundeck...@googlegroups.com
Hi,
 
I'm using Rundeck 2.0.0, and unable to successfully use the job.execid context variable of a reference job. The scenario:
 
1. job A calls job B via a reference job node step
2. job B uses two steps:
    2.1. step one is the main task to be performed
    2.2. step two parses the ouput log of step one using job B's job.execid context variable, and fails the job if a certain string isn't present
3. when job B executes, it doesn't have its own job.execid, or even generate an output log in its job.id directory. 
 
So step 2.2. errors out because it tries to open the output log of job B, but using the execid of job A. Of course job A's execid output log doesn't exist in job B's log folder, so the step fails.
 
Is there a way around this? Any feedback appreciated.
 
Thanks,
Robert.

robert...@gmail.com

unread,
Apr 18, 2014, 4:21:08 PM4/18/14
to rundeck...@googlegroups.com
I should note that the secondary/referenced job runs fine when executed directly and produces the expected result, it's only an issue when the job is called by another job. In which case the child job context variable is basically ignored. Hope this makes sense. So basically this prevents me from building a workflow that utilizes pre-existing jobs. I could just duplicate all child jobs within the top level job, but that wouldn't be ideal from a job maintenance perspective.
 
Thanks,
Robert.

Greg Schueler

unread,
Apr 18, 2014, 4:29:57 PM4/18/14
to robert...@gmail.com, rundeck...@googlegroups.com
Hi Robert,

you are correct that the job.execid and job.id would not let you determine the correct output log location for the original execution while you are running a job reference.  In that case hte job.id would indicate the job reference, and job.execid indicates the execution, but you wouldn't necessarily know the original job.id.

If you'd like to file an enhancement request, perhaps we can add something like "job.rootid" to indicate the original job when within a job reference

in the longer term, we plan to provide a solution to passing data between steps, so I you wouldn't need to parse the output log file to get data you can use in later steps.

--
Greg Schueler
--
You received this message because you are subscribed to the Google Groups "rundeck-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rundeck-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

robert...@gmail.com

unread,
Apr 21, 2014, 3:48:27 PM4/21/14
to rundeck...@googlegroups.com
Great, thank you Greg.

On Thursday, April 17, 2014 11:29:39 AM UTC-4, robert...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages