Assign variable to previous node/node list in job workflow
44 views
Skip to first unread message
Loth
unread,
Feb 1, 2023, 5:00:00 PM2/1/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rundeck-discuss
Hey All,
I have a task that requires things to be migrated from one node to the previous in a chain. To do this I need to make a job that can reference either one of the following;
1. The entire node list used for a job, in order of execution (taking account the rank attribute). From this I can identify the current node and subtract one for my purpose.
2. Find the previous node in the execution list (NULL if the first node)
Are any of these possible in the community version of rundeck?
Thanks for any replies.
rac...@rundeck.com
unread,
Feb 2, 2023, 9:15:02 AM2/2/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
I made a curl call that prints the node list used for a job (considering the rank attribute order), keep in mind that by design, that node info is only available after an execution.
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rundeck...@googlegroups.com
Hello,
Thanks for the reply.
I do need this data for the current job execution, I know it is not
available at the current execution however is it available on step 2+
of the same job, or only after the job is 100% completed? If this is
the case, is my option #2 viable?
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rundeck-discuss
The second option sounds viable, a good approach could be to build this in an inline script step or on different steps:
a) Run the first job via API (you can use this endpoint).
b) Wait some seconds.
c) Get the execution id (from "a", this needs some "script-fu", the jq tool could be useful)
d) Use the api+jq call to get the previous job execution nodes and then save it on a data variable.
Regards!
Loth
unread,
Feb 2, 2023, 2:41:04 PM2/2/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rundeck...@googlegroups.com
Ok thanks, this sounds doable. So the first job would just be a dummy
run (just an echo or something) to get this data into the RD API? And
the second is where the workflow that actually needs this data
happens?